removed hard code path for multi user
authorintae, jeon <intae.jeon@samsung.com>
Mon, 7 Mar 2016 07:36:18 +0000 (16:36 +0900)
committerintae, jeon <intae.jeon@samsung.com>
Mon, 7 Mar 2016 07:36:18 +0000 (16:36 +0900)
Signed-off-by: intae, jeon <intae.jeon@samsung.com>
email-core/email-core-gmime.c
email-core/email-core-utils.c
utilities/test-application/testapp-account.c
utilities/test-application/testapp-mail.c

index be4a739..d44a263 100755 (executable)
@@ -32,6 +32,7 @@
 #include <sys/time.h>
 #include <glib.h>
 #include <glib/gstdio.h>
+#include <tzplatform_config.h>
 
 #include "email-internal-types.h"
 #include "email-utilities.h"
@@ -46,6 +47,7 @@
 #include "email-core-signal.h"
 #include "email-core-mailbox-sync.h"
 #include "email-debug-log.h"
+#include "email-types.h"
 
 static int multipart_status = 0;
 
@@ -64,7 +66,7 @@ INTERNAL_FUNC void emcore_gmime_init(void)
        g_mime_init(0);
 
 #ifdef __FEATURE_SECURE_PGP__
-       setenv("GNUPGHOME", "/opt/usr/apps/org.tizen.email/data/.gnupg", 1);
+       setenv("GNUPGHOME", tzplatform_mkpath(TZ_SYS_RW_APP ,"org.tizen.email/data/.gnupg"), 1);
 #endif
 
        EM_DEBUG_FUNC_END();
index 737d662..4d80815 100755 (executable)
 #define EMAIL_CH_SQUARE_BRACKET_S '['
 #define EMAIL_CH_SQUARE_BRACKET_E ']'
 #define EMAIL_CH_SPACE            ' '
-#define EMAIL_NOTI_ICON_PATH                "/usr/apps/org.tizen.quickpanel/shared/res/noti_icons/E-mail/noti_email.png"
-#define EMAIL_NOTI_INDICATOR_ICON_PATH      "/usr/apps/org.tizen.indicator/res/icons/Event/B03_Event_email.png"
+#define EMAIL_NOTI_ICON_PATH                tzplatform_mkpath(TZ_SYS_RO_APP,  "org.tizen.quickpanel/shared/res/noti_icons/E-mail/noti_email.png")
+#define EMAIL_NOTI_INDICATOR_ICON_PATH      tzplatform_mkpath(TZ_SYS_RO_APP,  "org.tizen.indicator/res/icons/Event/B03_Event_email.png")
 #define EMAIL_NOTI_MAX_MAIL_ID   100
-
+//#define TEST                         TZ_SYS_RO_APPS
 
 typedef struct  _em_transaction_info_type_t {
        int mail_id;
@@ -1458,7 +1458,7 @@ INTERNAL_FUNC int emcore_add_notification(char *multi_user_name, int account_id,
                goto FINISH_OFF;
        }
 
-       if ((noti_err = notification_set_text_domain(noti, NATIVE_EMAIL_DOMAIN, "/usr/apps/org.tizen.email/res/locale")) != NOTIFICATION_ERROR_NONE) {
+       if ((noti_err = notification_set_text_domain(noti, NATIVE_EMAIL_DOMAIN, tzplatform_mkpath(TZ_SYS_RO_APP,"org.tizen.email/res/locale"))) != NOTIFICATION_ERROR_NONE) {
                EM_DEBUG_EXCEPTION("notification_set_text_domain failed [%d]", noti_err);
                err = EMAIL_ERROR_SYSTEM_FAILURE;
                goto FINISH_OFF;
@@ -1724,7 +1724,7 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac
                textdomain("sys_string");
 */
                setlocale(LC_MESSAGES, vconf_get_str(VCONFKEY_LANGSET));
-               bindtextdomain(NATIVE_EMAIL_DOMAIN, "/usr/apps/org.tizen.email/res/locale");
+               bindtextdomain(NATIVE_EMAIL_DOMAIN, tzplatform_mkpath(TZ_SYS_RO_APP,"org.tizen.email/res/localea"));
                textdomain(NATIVE_EMAIL_DOMAIN);
 
                switch (sending_error) {
@@ -1845,7 +1845,7 @@ INTERNAL_FUNC int emcore_add_notification_for_send(char *multi_user_name, int ac
 
        case EMAIL_ACTION_SENDING_MAIL:
 
-               if ((noti_err = notification_set_text_domain(noti, NATIVE_EMAIL_DOMAIN, "/usr/apps/org.tizen.email/res/locale")) != NOTIFICATION_ERROR_NONE) {
+               if ((noti_err = notification_set_text_domain(noti, NATIVE_EMAIL_DOMAIN, tzplatform_mkpath(TZ_SYS_RO_APP,"org.tizen.email/res/locale"))) != NOTIFICATION_ERROR_NONE) {
                        EM_DEBUG_EXCEPTION("notification_set_text_domain failed [%d]", noti_err);
                        err = EMAIL_ERROR_NOTI;
                        goto FINISH_OFF;
index 84cb27d..5cb81d5 100755 (executable)
 #include "email-api-smime.h"
 #include "email-api-account.h"
 #include "email-api-network.h"
+#include "email-types.h"
 
 /* internal header */
 #include "testapp-utility.h"
 #include "testapp-account.h"
 #include <sys/time.h>
 #include <sys/times.h>
+#include <tzplatform_config.h>
 
 /* internal defines */
 
@@ -770,7 +772,7 @@ FINISH_OFF:
 
 static gboolean testapp_test_backup_account()
 {
-       char *file_name = "/opt/usr/data/email/accounts_file";
+       char *file_name = tzplatform_mkpath(TZ_SYS_DATA, "email/accounts_file");
        int error_code;
        error_code = email_backup_accounts_into_secure_storage(file_name);
        testapp_print("\n email_backup_accounts_into_secure_storage returned [%d]\n", error_code);
@@ -778,7 +780,7 @@ static gboolean testapp_test_backup_account()
 }
 static gboolean testapp_test_restore_account()
 {
-       char *file_name = "/opt/usr/data/email/accounts_file";
+       char *file_name = tzplatform_mkpath(TZ_SYS_DATA,"email/accounts_file");
        int error_code;
        error_code = email_restore_accounts_from_secure_storage(file_name);
        testapp_print("\n email_restore_accounts_from_secure_storage returned [%d]\n", error_code);
index 01a50be..c9ccf68 100755 (executable)
@@ -2389,7 +2389,7 @@ static gboolean testapp_test_email_write_mime_file()
                return false;
        }
 
-       snprintf(file_path, 512, "/opt/usr/data/email/.email_data/tmp/%d_%8d.eml", mail_id, (int)time(NULL));
+       snprintf(file_path, 512, tzplatform_mkpath(TZ_SYS_DATA,"email/.email_data/tmp/%d_%8d.eml"), mail_id, (int)time(NULL));
 
        err = email_write_mime_file(mail_data, mail_attachment_data, attachment_count, &file_path);
        if (err != EMAIL_ERROR_NONE) {