Add code versioning for "SettingInfo TC"
authorgs_.jung <gs_.jung@samsung.com>
Tue, 22 Oct 2013 04:40:29 +0000 (13:40 +0900)
committergs_.jung <gs_.jung@samsung.com>
Tue, 22 Oct 2013 06:15:19 +0000 (15:15 +0900)
Change-Id: Ic2d8092c17d2b1aedc7800f80dc04bebc5b663a6

src/system/FSys_SettingInfoImpl.cpp

index 08eb519..4dd0031 100644 (file)
@@ -26,6 +26,7 @@
 #include <FBaseUtilStringUtil.h>
 #include <FIoFile.h>
 
+#include <FIo_FileImpl.h>
 #include <FApp_AppInfo.h>
 #include <FBase_StringConverter.h>
 #include <FBase_NativeError.h>
@@ -105,7 +106,7 @@ _SettingInfoImpl::GetValue(const Tizen::Base::String& key, Tizen::Base::String&
 
                if(key == _FONTSIZE)
                {
-                       if(_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat() == true)
+                       if(_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
                        {
                                if(value ==  _FONT_SIZE_GIANT || value == _FONT_SIZE_HUGE)
                                {
@@ -119,6 +120,16 @@ _SettingInfoImpl::GetValue(const Tizen::Base::String& key, Tizen::Base::String&
                InitSettingClient();
                SysTryReturnResult(NID_SYS, pSettingClient != null, E_SYSTEM, "It is failed to intialize setting manager");
                r = pSettingClient->GetValue(key, value);
+
+               if(key == L"Wallpaper")
+               {
+                       if(_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
+                       {
+                               String physicalFilePath = value;
+                               r = Tizen::Io::_FileImpl::ConvertPhysicalToVirtualPath(physicalFilePath, value);
+                               SysTryReturn(NID_SYS, r == E_SUCCESS, r, r, "[%s] It is failed to converting virtual path", GetErrorMessage(r));
+                       }
+               }
        }
        return r;
 }
@@ -170,7 +181,16 @@ _SettingInfoImpl::SetWallpaper(const Tizen::Base::String& filePath)
        result r = E_SUCCESS;
 
        SysTryReturnResult(NID_SYS, pSettingClient != null, E_SYSTEM, "It is failed to intialize setting manager");
-       r = pSettingClient->SetValue(_SETTING_SCREEN_WALLPAPER, filePath);
+
+       String physicalFilePath = filePath;
+
+       if(Tizen::App::_AppInfo::GetApiVersion() == _API_VERSION_2_0 && Tizen::App::_AppInfo::IsOspCompat())
+       {
+               r = Tizen::Io::_FileImpl::ConvertVirtualToPhysicalPath(filePath, physicalFilePath);
+               SysTryReturn(NID_SYS, r == E_SUCCESS, r, r, "[%s] It is failed to converting physical path", GetErrorMessage(r));
+       }
+
+       r = pSettingClient->SetValue(_SETTING_SCREEN_WALLPAPER, physicalFilePath);
 
        if(r == E_INVALID_ARG)
                r = E_FILE_NOT_FOUND;
@@ -213,13 +233,23 @@ _SettingInfoImpl::SetValue(const String& key, String value)
 {
        result r = E_SUCCESS;
        if (key == _FONT_SIZE || key == _FONT_TYPE)
-        {
+       {
                r = SetValueForFont(key, value);
-        }
+       }
        else
        {
                InitSettingClient();
                SysTryReturnResult(NID_SYS, pSettingClient != null, E_SYSTEM, "It is failed to intialize setting manager");
+
+               if(key == _SETTING_SCREEN_WALLPAPER)
+               {
+                       if(_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
+                       {
+                               String virtualFilePath = value;
+                               r = Tizen::Io::_FileImpl::ConvertVirtualToPhysicalPath(virtualFilePath, value);
+                               SysTryReturn(NID_SYS, r == E_SUCCESS, r, r, "[%s] It is failed to converting physical path", GetErrorMessage(r));
+                       }
+               }
                return pSettingClient->SetValue(key, value);
        }
        return r;