X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fsystem%2FFSys_SettingInfoImpl.cpp;h=4dd00313a43aeb8218c10b0cb65cb21312c58525;hb=fb718301c0247e55776ebf661b9b6217f1f84cbe;hp=bc30c23b54746482110be5f3d9916447072bbc21;hpb=5ba8ce1cc0e083b2a85ae6061f4921294b45fbaa;p=platform%2Fframework%2Fnative%2Fappfw.git diff --git a/src/system/FSys_SettingInfoImpl.cpp b/src/system/FSys_SettingInfoImpl.cpp index bc30c23..4dd0031 100644 --- a/src/system/FSys_SettingInfoImpl.cpp +++ b/src/system/FSys_SettingInfoImpl.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -43,9 +44,6 @@ using namespace Tizen::Base::Utility; namespace Tizen { namespace System { -//IDs for IPC -static const int _SYSTEM_RESPONSE_DATA = 2; - //Reserved key static const wchar_t* _SETTING_SCREEN_WALLPAPER = L"http://tizen.org/setting/screen.wallpaper"; static const wchar_t* _SETTING_SYSTEM_SOUND_VOLUME = L"SystemSoundVolume"; @@ -108,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) { @@ -122,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; } @@ -173,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; @@ -216,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;