TSAM-252[SE][WebTCT][TizenSDK_3.0_RC4][Mobile][64bit][tct-time-tizen-tests] 14/49614/1 accepted/tizen_mobile accepted/tizen/mobile/20151016.044234 submit/tizen/20151109.081121 submit/tizen_mobile/20151016.014758 submit/tizne_mobile/20151016.002927 tizen_3.0.m2.a1_mobile_release
authorIgor Olshevskyi <i.olshevskyi@samsung.com>
Thu, 15 Oct 2015 12:33:29 +0000 (15:33 +0300)
committerGennadiy Azarov <gen.azarov@samsung.com>
Thu, 15 Oct 2015 14:04:55 +0000 (17:04 +0300)
Change-Id: I1cfcac90f1a04bcdb26c351e0c10530d029ff6b0
Signed-off-by: Igor Olshevskyi <i.olshevskyi@samsung.com>
include/worldclock_const.h
packaging/libug-worldclock-efl.spec
src/CMakeLists.txt
src/worldclock_data.c

index 4446112..b546838 100644 (file)
@@ -43,9 +43,6 @@
 #define WCL_EDJ_NAME                WCL_EDJ_PATH"/ug_worldclock.edj"
 #define WCL_THEME_NAME              WCL_EDJ_PATH"/ug_worldclock_theme.edj"
 
-//#define WORLDCLOCK_FILE_PATH  "/opt/.worldclock.txt"
-#define WORLDCLOCK_DB           "/opt/dbspace/.worldclock.db"
-
 #define VCONFKEY_SETAPPL_PREFIX         "db/setting"
 #define SETTING_THEME_SELECTED_THEME   VCONFKEY_SETAPPL_PREFIX"/selected_theme"
 
index f928a3b..8092c95 100644 (file)
@@ -23,6 +23,7 @@ BuildRequires:  pkgconfig(icu-i18n)
 BuildRequires:  cmake
 BuildRequires:  edje-tools
 BuildRequires:  gettext-tools
+BuildRequires:  pkgconfig(libtzplatform-config)
 
 %description
 Worldclock UI gadget
@@ -43,13 +44,13 @@ rm -rf %{buildroot}
 %post
 /sbin/ldconfig
 
-CITY_TABLE_FILE="/opt/dbspace/.worldclock.db"
+CITY_TABLE_FILE="%{TZ_SYS_DB}/.worldclock.db"
 
 if [ ! -e "$CITY_TABLE_FILE" ]
 then
 
 #create db
-sqlite3 /opt/dbspace/.worldclock.db 'PRAGMA journal_mode = PERSIST;
+sqlite3 %{TZ_SYS_DB}/.worldclock.db 'PRAGMA journal_mode = PERSIST;
                CREATE TABLE city_table (idex int primary key, city varchar(128), country varchar(128), timezone varchar(20), dst_type int, dst_enabled int, selected int, sequence int, tz_path varchar(128));
                INSERT INTO "city_table" VALUES(0,"IDS_WCL_BODY_CITYNAME_ABIDJAN","IDS_WCL_BODY_COTE_DIVOIRE","GMT+0",0,1,0,0,"Africa/Abidjan");
                INSERT INTO "city_table" VALUES(1,"IDS_WCL_BODY_CITYNAME_ABUDHABI","IDS_WCL_BODY_UNITED_ARAB_EMIRATES","GMT+4",0,1,0,0,"Asia/Dubai");
@@ -361,13 +362,15 @@ fi
 
 
 # Change file owner
-chown :6015 /opt/dbspace/.worldclock.db
-chown :6015 /opt/dbspace/.worldclock.db-journal
-chmod 664 /opt/dbspace/.worldclock.db
-chmod 664 /opt/dbspace/.worldclock.db-journal
+chown :$UID %{TZ_SYS_DB}/.worldclock.db
+chown :$UID %{TZ_SYS_DB}/.worldclock.db-journal
+chmod 664 %{TZ_SYS_DB}/.worldclock.db
+chmod 664 %{TZ_SYS_DB}/.worldclock.db-journal
 
-%postun -p /sbin/ldconfig
+chsmack -a 'System::Shared' %{TZ_SYS_DB}/.worldclock.db
+chsmack -a 'System::Shared' %{TZ_SYS_DB}/.worldclock.db-journal
 
+%postun -p /sbin/ldconfig
 
 %files
 %manifest %{name}.manifest
index f9cc52b..0a462a6 100644 (file)
@@ -13,6 +13,7 @@ pkg_check_modules(pkgs REQUIRED appcore-efl elementary db-util
                                                glib-2.0 dlog vconf
                                                ui-gadget-1 bundle
                         icu-i18n
+                        libtzplatform-config
                                                )
 
 FOREACH(flag ${pkgs_CFLAGS})
index e0d5492..e57a9d4 100644 (file)
@@ -21,6 +21,7 @@
 #include <fcntl.h>
 
 #include <vconf.h>
+#include <tzplatform_config.h>
 
 #include "worldclock.h"
 #include "worldclock_data.h"
@@ -28,6 +29,7 @@
 #include "worldclock_types.h"
 #include "worldclock_util.h"
 
+#define WORLDCLOCK_DB               tzplatform_mkpath(TZ_SYS_DB, ".worldclock.db")
 #define WORLDCLOCK_DB_QUERY_LEN     512
 #define WORLDCLOCK_DB_TABLE_CITY    "city_table"