From fec00921e31f772dbc1b3c79c4b92ba9d080ff74 Mon Sep 17 00:00:00 2001 From: HyukSoon Choi Date: Thu, 18 Apr 2013 10:53:11 +0900 Subject: [PATCH] Fix TDIS-5349 Change-Id: Ic803e388a75702577f98594af0ff2eed2d7c94a2 Signed-off-by: HyukSoon Choi --- inc/IvSettingPresentationModel.h | 5 +--- src/IvSettingPresentationModel.cpp | 57 ++++++++++---------------------------- 2 files changed, 16 insertions(+), 46 deletions(-) diff --git a/inc/IvSettingPresentationModel.h b/inc/IvSettingPresentationModel.h index 486aeca..fc85ea1 100644 --- a/inc/IvSettingPresentationModel.h +++ b/inc/IvSettingPresentationModel.h @@ -27,8 +27,6 @@ class SettingPresentationModel public: result GetValue(const Tizen::Base::String& strSectionName, const Tizen::Base::String& entryName, int& value) const; - result GetValue(const Tizen::Base::String& strSectionName, const Tizen::Base::String& entryName, - Tizen::Base::String& value) const; static SettingPresentationModel* GetInstance(void); @@ -43,11 +41,10 @@ private: static void CreateInstance(void); static void DestroyInstance(void); - SettingPresentationModel& operator = (SettingPresentationModel&); + SettingPresentationModel& operator=(SettingPresentationModel&); private: static SettingPresentationModel* __pPresentationModelInstance; - Tizen::Io::Registry* __pAppGalleryRegistry; }; #endif /* _IV_SETTING_PRESENTATION_MODEL_H_ */ diff --git a/src/IvSettingPresentationModel.cpp b/src/IvSettingPresentationModel.cpp index 969f444..9aeabdc 100644 --- a/src/IvSettingPresentationModel.cpp +++ b/src/IvSettingPresentationModel.cpp @@ -43,7 +43,6 @@ const wchar_t* SHUFFLE_VALUE = L"SHUFFLE_VALUE"; SettingPresentationModel* SettingPresentationModel::__pPresentationModelInstance = null; SettingPresentationModel::SettingPresentationModel(void) - : __pAppGalleryRegistry(null) { AppLogDebug("ENTER"); AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); @@ -72,8 +71,6 @@ result SettingPresentationModel::Construct(void) { AppLogDebug("ENTER"); - - __pAppGalleryRegistry = new (std::nothrow) Registry(); AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); return E_SUCCESS; @@ -118,48 +115,24 @@ SettingPresentationModel::GetValue(const String& strSectionName, const String& e { AppLogDebug("ENTER"); - result r = E_SUCCESS; - String valueRegistryString = L""; + result r = E_FAILURE; AppManager* pAppManager = AppManager::GetInstance(); - TryReturn(pAppManager != null, E_FAILURE, "Failed to get AppManager"); - String pathGallerySetting = - pAppManager->GetAppSharedPath(GALLERY_APP_ID) + PATH_DATA_DIRECTORY + PATH_GALLERY_SETTINGS; - - if (File::IsFileExist(pathGallerySetting)) - { - AppLogDebug("Already exist camcorder settings file"); - __pAppGalleryRegistry->Construct(pathGallerySetting, "r"); - } - - if (__pAppGalleryRegistry != null) - { - r = __pAppGalleryRegistry->GetValue(strSectionName, entryName, value); - } - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); - - return r; -} - -result -SettingPresentationModel::GetValue(const String& strSectionName, const String& entryName, String& value) const -{ - AppLogDebug("ENTER"); - result r = E_SUCCESS; - String valueRegistryString = L""; - AppManager* pAppManager = AppManager::GetInstance(); - TryReturn(pAppManager != null, E_FAILURE, "Failed to get AppManager"); - String pathGallerySetting = - pAppManager->GetAppSharedPath(GALLERY_APP_ID) + PATH_DATA_DIRECTORY + PATH_GALLERY_SETTINGS; - - if (File::IsFileExist(pathGallerySetting)) - { - AppLogDebug("Already exist camcorder settings file"); - __pAppGalleryRegistry->Construct(pathGallerySetting, "r"); - } - if (__pAppGalleryRegistry != null) + if (pAppManager != null) { - r = __pAppGalleryRegistry->GetValue(strSectionName, entryName, value); + String pathGallerySetting = pAppManager->GetAppSharedPath(GALLERY_APP_ID) + PATH_DATA_DIRECTORY + + PATH_GALLERY_SETTINGS; + + if (File::IsFileExist(pathGallerySetting)) + { + Registry registry; + r = registry.Construct(pathGallerySetting, "r"); + + if (r == E_SUCCESS) + { + r = registry.GetValue(strSectionName, entryName, value); + } + } } AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); -- 2.7.4