From 8789adea7dae840914101a770a25ed5ef04e3f73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?K=C3=A9vin=20THIERRY?= Date: Tue, 18 Feb 2014 14:56:23 +0100 Subject: [PATCH] Add multi-user support MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bug-Tizen: PTREL-306 Change-Id: Idaa141458c0f0fed9be06625320db4cd1d22cd63 Signed-off-by: Kévin THIERRY --- CMakeLists.txt | 1 + TC/testcase/utc_system_settings.c | 7 ++++++- TC_gui/main.c | 12 ++++++++---- packaging/capi-system-system-settings.spec | 7 ++++--- src/system_setting_platform.c | 5 ++++- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91ef82e..107ea1a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ SET(requires elementary ecore ${WIN_PKG} ecore-file appcore-efl capi-base-common glib-2.0 gobject-2.0 fontconfig libxml-2.0 + libtzplatform-config ) SET(pc_requires "capi-base-common") diff --git a/TC/testcase/utc_system_settings.c b/TC/testcase/utc_system_settings.c index a433610..1005bc3 100755 --- a/TC/testcase/utc_system_settings.c +++ b/TC/testcase/utc_system_settings.c @@ -27,6 +27,9 @@ #include #include +/* For multi-user support */ +#include + static void startup(void); static void cleanup(void); @@ -98,7 +101,9 @@ static void utc_system_settings_changed_motion_activation(system_settings_key_e static void utc_system_settings_set_string_p(void) { - int retcode = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/share/settings/Ringtones/General_Over the horizon.mp3"); + const char *path_to_mp3 = tzplatform_mkpath(TZ_SYS_SHARE, "settings/Ringtones/General_Over the horizon.mp3"); + + int retcode = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, path_to_mp3); if (retcode == SYSTEM_SETTINGS_ERROR_NONE) { dts_pass(API_NAME_SETTINGS_SET_VALUE_STRING, "passed"); diff --git a/TC_gui/main.c b/TC_gui/main.c index 79daa7b..9559235 100644 --- a/TC_gui/main.c +++ b/TC_gui/main.c @@ -17,6 +17,9 @@ #include #include +/* For multi-user support */ +#include + static void _quit_cb(void *data, Evas_Object* obj, void* event_info) { Evas_Object *win = (Evas_Object *) data; @@ -193,7 +196,7 @@ void system_settings_changed_motion_activation(system_settings_key_e key, void * } void list_item_touch_handler7(void* data, Evas_Object* obj, void* event_info) { - char* path = "/opt/usr/media/Images/image16.jpg"; + const char* path = tzplatform_mkpath(TZ_USER_CONTENT, "Images/image16.jpg"); int ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, "/aaa.png"); SETTING_TRACE(">>>>>>>> home screen - error case :: %d ", ret); @@ -204,7 +207,7 @@ void list_item_touch_handler7(void* data, Evas_Object* obj, void* event_info) void list_item_touch_handler8(void* data, Evas_Object* obj, void* event_info) { - char* path = "/opt/usr/media/Images/image16.jpg"; + const char* path = tzplatform_mkpath(TZ_USER_CONTENT, "Images/image16.jpg"); int ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, "aaa.png"); SETTING_TRACE(">>>>>>>> lock screen - error case : %d ", ret); @@ -273,8 +276,9 @@ void list_item_touch_handler16(void* data, Evas_Object* obj, void* event_info) SETTING_TRACE(">>>>>>>> get ringtone path - exception case "); int ret; char *ringtonepath = NULL; - //opt/share/settings/Ringtones/Over the horizon.mp3 - ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, "/opt/share/settings/Ringtones/Over the horizon.mp3"); + const char *path_to_mp3 = tzplatform_mkpath(TZ_SYS_SHARE, "settings/Ringtones/Over the horizon.mp3"); + + ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, path_to_mp3); ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, &ringtonepath); SETTING_TRACE(" 1 current ringtone path : (%s) ", ringtonepath); // set the key to the wrong value diff --git a/packaging/capi-system-system-settings.spec b/packaging/capi-system-system-settings.spec index c3e7496..79a1d54 100755 --- a/packaging/capi-system-system-settings.spec +++ b/packaging/capi-system-system-settings.spec @@ -4,12 +4,12 @@ Name: capi-system-system-settings Summary: A System Settings library in Tizen Native API Version: 0.0.2 -Release: 3 +Release: 0 Group: System/API License: Apache-2.0 Source0: %{name}-%{version}.tar.gz -Source1001: %{name}.manifest -Source1002: %{name}-devel.manifest +Source1001: %{name}.manifest +Source1002: %{name}-devel.manifest BuildRequires: cmake BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(vconf) @@ -29,6 +29,7 @@ BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gobject-2.0) BuildRequires: pkgconfig(fontconfig) BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(libtzplatform-config) %description A System Settings library in Tizen Native API. diff --git a/src/system_setting_platform.c b/src/system_setting_platform.c index ef3843a..e877ca3 100755 --- a/src/system_setting_platform.c +++ b/src/system_setting_platform.c @@ -45,13 +45,16 @@ #include #include +/* For multi-user support */ +#include + #define SMALL_FONT_DPI (-80) #define MIDDLE_FONT_DPI (-100) #define LARGE_FONT_DPI (-150) #define HUGE_FONT_DPI (-190) #define GIANT_FONT_DPI (-250) -#define SETTING_FONT_CONF_FILE "/opt/etc/fonts/conf.avail/99-slp.conf" +#define SETTING_FONT_CONF_FILE tzplatform_mkpath(TZ_SYS_ETC, "fonts/conf.avail/99-slp.conf") #define SETTING_STR_SLP_LEN 256 static char* _get_cur_font(); -- 2.7.4