summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiwoong Im <jiwoong.im@samsung.com>2014-03-17 15:10:40 +0900
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>2014-03-18 01:29:06 -0700
commitc92cec0e876d638b91eb64e12e306e9a29ed2e8f (patch)
tree16c088f0c323e8786b5342daf4922d41033ee598
parent93974ec6cbdf65e867ac41921ff0faae341040c5 (diff)
downloadapplication-tizen_3.0.m14.2_ivi.tar.gz
application-tizen_3.0.m14.2_ivi.tar.bz2
application-tizen_3.0.m14.2_ivi.zip
Bug-Tizen: PTREL-258 Change-Id: If4d974a2b064fcebd7b5cece39a60e97e324b6b4 Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
-rw-r--r--CMakeLists.txt2
-rwxr-xr-xinclude/app_private.h15
-rwxr-xr-xpackaging/capi-appfw-application.spec1
-rwxr-xr-xsrc/app_main.c6
-rwxr-xr-xsrc/app_resource.c7
-rwxr-xr-xsrc/storage_internal.c4
6 files changed, 22 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e05184c..1ce05ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,7 +9,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(INC_DIR include)
INCLUDE_DIRECTORIES(${INC_DIR})
-SET(requires "dlog bundle appcore-common appcore-efl aul ail appsvc notification elementary capi-base-common alarm-service sqlite3")
+SET(requires "dlog bundle appcore-common appcore-efl aul ail appsvc notification elementary capi-base-common alarm-service sqlite3 libtzplatform-config")
SET(pc_requires "capi-base-common")
INCLUDE(FindPkgConfig)
diff --git a/include/app_private.h b/include/app_private.h
index 795a642..c3a6a15 100755
--- a/include/app_private.h
+++ b/include/app_private.h
@@ -19,6 +19,7 @@
#define __TIZEN_APPFW_APP_PRIVATE_H__
#include <appcore-common.h>
+#include <tzplatform_config.h>
// GNU gettext macro is already defined at appcore-common.h
#ifdef _
@@ -33,14 +34,14 @@ extern "C" {
#define TIZEN_PATH_MAX 1024
-#define PATH_FMT_APP_ROOT "/opt/usr/apps"
-#define PATH_FMT_RES_DIR PATH_FMT_APP_ROOT "/%s/res"
-#define PATH_FMT_LOCALE_DIR PATH_FMT_RES_DIR "/locale"
-#define PATH_FMT_DATA_DIR PATH_FMT_APP_ROOT "/%s/data"
+#define PATH_FMT_APP_ROOT tzplatform_getenv(TZ_USER_APP)
+#define PATH_FMT_RES_DIR "/res"
+#define PATH_FMT_LOCALE_DIR "/locale"
+#define PATH_FMT_DATA_DIR "/data"
-#define PATH_FMT_RO_APP_ROOT "/usr/apps"
-#define PATH_FMT_RO_RES_DIR PATH_FMT_RO_APP_ROOT "/%s/res"
-#define PATH_FMT_RO_LOCALE_DIR PATH_FMT_RO_RES_DIR "/locale"
+#define PATH_FMT_RO_APP_ROOT tzplatform_getenv(TZ_SYS_RO_APP)
+#define PATH_FMT_RO_RES_DIR "/res"
+#define PATH_FMT_RO_LOCALE_DIR "/local"
typedef void (*app_finalizer_cb) (void *data);
diff --git a/packaging/capi-appfw-application.spec b/packaging/capi-appfw-application.spec
index ff6ce4c..14b043c 100755
--- a/packaging/capi-appfw-application.spec
+++ b/packaging/capi-appfw-application.spec
@@ -19,6 +19,7 @@ BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(alarm-service)
BuildRequires: pkgconfig(capi-base-common)
BuildRequires: pkgconfig(sqlite3)
+BuildRequires: pkgconfig(libtzplatform-config)
diff --git a/src/app_main.c b/src/app_main.c
index 81f4f5e..1b58f72 100755
--- a/src/app_main.c
+++ b/src/app_main.c
@@ -146,9 +146,11 @@ int app_appcore_create(void *data)
app_set_appcore_event_cb(app_context);
- snprintf(locale_dir, TIZEN_PATH_MAX, PATH_FMT_LOCALE_DIR, app_context->package);
+ snprintf(locale_dir, TIZEN_PATH_MAX, "%s/%s" PATH_FMT_RES_DIR
+ PATH_FMT_LOCALE_DIR, PATH_FMT_APP_ROOT, app_context->package);
if (access(locale_dir, R_OK) != 0) {
- snprintf(locale_dir, TIZEN_PATH_MAX, PATH_FMT_RO_LOCALE_DIR, app_context->package);
+ snprintf(locale_dir, TIZEN_PATH_MAX, "%s/%s" PATH_FMT_RO_RES_DIR
+ PATH_FMT_RO_LOCALE_DIR, PATH_FMT_RO_APP_ROOT, app_context->package);
}
appcore_set_i18n(app_context->app_name, locale_dir);
diff --git a/src/app_resource.c b/src/app_resource.c
index a3c2da5..cadcee8 100755
--- a/src/app_resource.c
+++ b/src/app_resource.c
@@ -33,14 +33,17 @@
#include <app_private.h>
#include <app_service_private.h>
+#include <tzplatform_config.h>
+
#ifdef LOG_TAG
#undef LOG_TAG
#endif
#define LOG_TAG "CAPI_APPFW_APPLICATION"
-static const char *INSTALLED_PATH = "/opt/usr/apps";
-static const char *RO_INSTALLED_PATH = "/usr/apps";
+#define INSTALLED_PATH tzplatform_getenv(TZ_USER_APP)
+#define RO_INSTALLED_PATH tzplatform_getenv(TZ_SYS_RO_APP)
+
static const char *RES_DIRECTORY_NAME = "res";
static const char *DATA_DIRECTORY_NAME = "data";
diff --git a/src/storage_internal.c b/src/storage_internal.c
index 9698630..ef59f29 100755
--- a/src/storage_internal.c
+++ b/src/storage_internal.c
@@ -27,13 +27,15 @@
#include <app_storage.h>
#include <app_storage_private.h>
+#include <tzplatform_config.h>
+
#ifdef LOG_TAG
#undef LOG_TAG
#endif
#define LOG_TAG "CAPI_APPFW_APPLICATION_STORAGE"
-#define INTERNAL_MEMORY_PATH "/opt/usr/media"
+#define INTERNAL_MEMORY_PATH tzplatform_getenv(TZ_USER_CONTENT)
int storage_internal_get_state()
{