Add multi-user support 42/16542/3 accepted/tizen_3.0.2014.q3_common accepted/tizen_3.0.m14.3_ivi accepted/tizen_generic accepted/tizen_ivi_panda tizen_3.0.2014.q3_common tizen_3.0.2014.q4_common tizen_3.0.2015.q1_common tizen_3.0.2015.q2_common tizen_3.0.m14.2_ivi tizen_3.0.m14.3_ivi tizen_3.0_ivi accepted/tizen/generic/20140408.111815 accepted/tizen/ivi/20140409.182456 accepted/tizen/ivi/panda/20140408.203040 submit/tizen/20140408.111725 submit/tizen_common/20140521.232441 submit/tizen_common/20140522.140947 submit/tizen_mobile/20141120.000000 tizen_3.0.2014.q3_common_release tizen_3.0.m14.2_ivi_release tizen_3.0.m14.3_ivi_release tizen_3.0_ivi_release
authorKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Tue, 18 Feb 2014 13:56:23 +0000 (14:56 +0100)
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Thu, 27 Mar 2014 13:53:28 +0000 (14:53 +0100)
Bug-Tizen: PTREL-306
Change-Id: Idaa141458c0f0fed9be06625320db4cd1d22cd63
Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
CMakeLists.txt
TC/testcase/utc_system_settings.c
TC_gui/main.c
packaging/capi-system-system-settings.spec
src/system_setting_platform.c

index 91ef82e..107ea1a 100755 (executable)
@@ -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")
index a433610..1005bc3 100755 (executable)
@@ -27,6 +27,9 @@
 #include <glib.h>
 #include <glib-object.h>
 
+/* For multi-user support */
+#include <tzplatform_config.h>
+
 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");
index 79daa7b..9559235 100644 (file)
@@ -17,6 +17,9 @@
 #include <system_settings.h>
 #include <system_settings_private.h>
 
+/* For multi-user support */
+#include <tzplatform_config.h>
+
 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
index c3e7496..79a1d54 100755 (executable)
@@ -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.
index ef3843a..e877ca3 100755 (executable)
 #include <system_settings.h>
 #include <system_settings_private.h>
 
+/* For multi-user support */
+#include <tzplatform_config.h>
+
 #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();