Add multi-user support 83/18183/2 submit/tizen_common/20140521.163740 submit/tizen_common/20140522.130648 submit/tizen_common/20140522.135644 submit/tizen_ivi/20140618.000000 submit/tizen_ivi/20140618.000001 submit/tizen_ivi/20140619.000000 submit/tizen_ivi/20140622.000000 submit/tizen_ivi/20140623.000000
authorJiwoong Im <jiwoong.im@samsung.com>
Mon, 17 Mar 2014 05:41:37 +0000 (14:41 +0900)
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Tue, 18 Mar 2014 08:36:25 +0000 (01:36 -0700)
Bug-Tizen: PTREL-322
Change-Id: I0832b33c74da0ee572fab3ef868a47fe2ebb3bcb
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
CMakeLists.txt
packaging/app-core.spec
src/appcore.c

index b4dba81..ed8271a 100644 (file)
@@ -34,7 +34,7 @@ ENDIF (with_wayland)
 SET(HEADERS_common appcore-common.h)
 
 INCLUDE(FindPkgConfig)
-SET(APPCORE_PKG_CHECK_MODULES "vconf sensor aul dlog")
+SET(APPCORE_PKG_CHECK_MODULES "vconf sensor aul dlog libtzplatform-config")
 
 IF (with_wayland)
        pkg_check_modules(pkg_common REQUIRED ${APPCORE_PKG_CHECK_MODULES} ecore)
index 666cfb6..8a2403f 100644 (file)
@@ -25,6 +25,7 @@ BuildRequires:  pkgconfig(elementary)
 BuildRequires:  pkgconfig(ecore)
 BuildRequires:  pkgconfig(gobject-2.0)
 BuildRequires:  pkgconfig(glib-2.0)
+BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  cmake
 
 
index 5d46048..c5dc1e1 100644 (file)
 #include <dlfcn.h>
 #include <vconf.h>
 #include <aul.h>
+#include <tzplatform_config.h>
 #include "appcore-internal.h"
 
 #define SQLITE_FLUSH_MAX               (1024*1024)
 
 #define PKGNAME_MAX 256
-#define PATH_APP_ROOT "/opt/usr/apps"
-#define PATH_RO_APP_ROOT "/usr/apps"
+#define PATH_APP_ROOT tzplatform_getenv(TZ_USER_APP)
+#define PATH_RO_APP_ROOT tzplatform_getenv(TZ_SYS_RO_APP)
 #define PATH_RES "/res"
 #define PATH_LOCALE "/locale"
 
@@ -146,11 +147,13 @@ static int __get_dir_name(char *dirname)
        if (aul_app_get_pkgname_bypid(pid, pkg_name, PKGNAME_MAX) != AUL_R_OK)
                return -1;
 
-       r = snprintf(dirname, PATH_MAX, PATH_APP_ROOT "/%s" PATH_RES PATH_LOCALE,pkg_name);
+       r = snprintf(dirname, PATH_MAX, "%s/%s" PATH_RES PATH_LOCALE,
+                       PATH_APP_ROOT, pkg_name);
        if (r < 0)
                return -1;
        if (access(dirname, R_OK) == 0) return 0;
-       r = snprintf(dirname, PATH_MAX, PATH_RO_APP_ROOT "/%s" PATH_RES PATH_LOCALE,pkg_name);
+       r = snprintf(dirname, PATH_MAX, "%s/%s" PATH_RES PATH_LOCALE,
+                       PATH_RO_APP_ROOT, pkg_name);
        if (r < 0)
                return -1;