From: HyukSoon Choi Date: Mon, 13 May 2013 15:11:27 +0000 (+0900) Subject: Fix TDIS-5756 X-Git-Tag: submit/tizen_2.1/20130514.051144^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cfc5309c5f20973a23afe5aa5e0a800fa28fbaea;p=apps%2Fosp%2FImageViewer.git Fix TDIS-5756 Change-Id: Ie17d7bf3c9472e0df98a42c4d994a772e39511e8 Signed-off-by: HyukSoon Choi --- diff --git a/inc/IvTypes.h b/inc/IvTypes.h index 84e2572..699f7f1 100644 --- a/inc/IvTypes.h +++ b/inc/IvTypes.h @@ -138,6 +138,7 @@ extern const wchar_t* SETTING_VALUE_HOME_SCREEN_WALLPAPER; extern const wchar_t* SETTING_VALUE_LOCK_SCREEN_WALLPAPER; extern const wchar_t* FOLDER_PATH_DOWNLOADS; +extern const wchar_t* PATH_DATA_DIRECTORY; extern const wchar_t* TEMP_FILE_PATH_HOME_SCREEN_WALLPAPER; extern const wchar_t* TEMP_FILE_PATH_LOCK_SCREEN_WALLPAPER; diff --git a/src/IvImageCropForm.cpp b/src/IvImageCropForm.cpp index 1c2a5f1..cfdf9a3 100644 --- a/src/IvImageCropForm.cpp +++ b/src/IvImageCropForm.cpp @@ -147,7 +147,6 @@ void ImageCropForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs) { AppLogDebug("ENTER pArgs(%x)", pArgs); - if (pArgs != null) { __sourceFilePath = *(static_cast(pArgs->GetAt(0))); @@ -286,7 +285,8 @@ ImageCropForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) int count = 1; int index = 0; String destFilePath; - destFilePath.Append(App::GetInstance()->GetAppDataPath()); + destFilePath.Append(App::GetInstance()->GetAppSharedPath()); + destFilePath.Append(PATH_DATA_DIRECTORY); destFilePath.Append(__pPresentationModel->GetFileName(__sourceFilePath)); destFilePath.Reverse(); destFilePath.IndexOf(FILE_EXT_SEPARATOR, 0, index); @@ -298,7 +298,8 @@ ImageCropForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) { count++; destFilePath.Clear(); - destFilePath.Append(App::GetInstance()->GetAppDataPath()); + destFilePath.Append(App::GetInstance()->GetAppSharedPath()); + destFilePath.Append(PATH_DATA_DIRECTORY); destFilePath.Append(__pPresentationModel->GetFileName(__sourceFilePath)); destFilePath.Insert(FILE_NAME_SEPARATOR, destFilePath.GetLength() - index - 1); destFilePath.Insert(count, destFilePath.GetLength() - index - 1); @@ -362,7 +363,7 @@ ImageCropForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) if (__statusValue == SET_AT_TYPE_HOME_SCREEN_WALLPAPER) { - String destPath = App::GetInstance()->GetAppDataPath() + TEMP_FILE_PATH_HOME_SCREEN_WALLPAPER; + String destPath = App::GetInstance()->GetAppSharedPath() + PATH_DATA_DIRECTORY + TEMP_FILE_PATH_HOME_SCREEN_WALLPAPER; r = pCropBuffer->EncodeToFile(destPath, IMG_FORMAT_JPG, true, 100); if (r == E_SUCCESS) { @@ -371,7 +372,7 @@ ImageCropForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) } else if (__statusValue == SET_AT_TYPE_LOCK_SCREEN_WALLPAPER) { - String destPath = App::GetInstance()->GetAppDataPath() + TEMP_FILE_PATH_LOCK_SCREEN_WALLPAPER; + String destPath = App::GetInstance()->GetAppSharedPath() + PATH_DATA_DIRECTORY + TEMP_FILE_PATH_LOCK_SCREEN_WALLPAPER; r = pCropBuffer->EncodeToFile(destPath, IMG_FORMAT_JPG, true, 100); if (r == E_SUCCESS) { @@ -380,8 +381,8 @@ ImageCropForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) } else if (__statusValue == SET_AT_TYPE_HOME_AND_LOCK_SCREEN_WALLPAPER) { - String destPath = App::GetInstance()->GetAppDataPath() + TEMP_FILE_PATH_LOCK_SCREEN_WALLPAPER; - String destPathHome = App::GetInstance()->GetAppDataPath() + TEMP_FILE_PATH_HOME_SCREEN_WALLPAPER; + String destPath = App::GetInstance()->GetAppSharedPath() + PATH_DATA_DIRECTORY + TEMP_FILE_PATH_LOCK_SCREEN_WALLPAPER; + String destPathHome = App::GetInstance()->GetAppSharedPath() + PATH_DATA_DIRECTORY + TEMP_FILE_PATH_HOME_SCREEN_WALLPAPER; r = pCropBuffer->EncodeToFile(destPath, IMG_FORMAT_JPG, true, 100); r = pCropBuffer->EncodeToFile(destPathHome, IMG_FORMAT_JPG, true, 100); if (r == E_SUCCESS) @@ -396,7 +397,7 @@ ImageCropForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) if (__sourceFilePath.IsEmpty() == false) { - destFilePath = App::GetInstance()->GetAppRootPath() + TEMP_FILE_PATH_CONTACT_IMAGE; + destFilePath = App::GetInstance()->GetAppSharedPath() + PATH_DATA_DIRECTORY + TEMP_FILE_PATH_CONTACT_IMAGE; r = pCropBuffer->EncodeToFile(destFilePath, IMG_FORMAT_JPG, true, 100); Contact* pContact = null; AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance(); diff --git a/src/IvImageViewerForm.cpp b/src/IvImageViewerForm.cpp index 3f44086..bf56b89 100644 --- a/src/IvImageViewerForm.cpp +++ b/src/IvImageViewerForm.cpp @@ -1107,7 +1107,7 @@ void ImageViewerForm::DownloadFile(void) { AppLogDebug("ENTER"); - String DestPath = App::GetInstance()->GetAppRootPath() + TEMP_FILE_PATH_WEB_FILE; + String DestPath = App::GetInstance()->GetAppSharedPath() + PATH_DATA_DIRECTORY + TEMP_FILE_PATH_WEB_FILE; if (File::IsFileExist(DestPath) == false) { AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult())); @@ -2156,7 +2156,7 @@ ImageViewerForm::OnImageDecodeUrlReceived (RequestId reqId, Bitmap *pBitmap, Image* pImage = new (std::nothrow) Image(); pImage->Construct(); - String destPath = App::GetInstance()->GetAppRootPath() + TEMP_FILE_PATH_WEB_FILE; + String destPath = App::GetInstance()->GetAppSharedPath() + PATH_DATA_DIRECTORY + TEMP_FILE_PATH_WEB_FILE; r = pImage->EncodeToFile(*pBitmap, IMG_FORMAT_JPG, destPath, true); if (r == E_SUCCESS) diff --git a/src/IvSettingPresentationModel.cpp b/src/IvSettingPresentationModel.cpp index 89d9437..d3af368 100644 --- a/src/IvSettingPresentationModel.cpp +++ b/src/IvSettingPresentationModel.cpp @@ -22,13 +22,13 @@ #include #include #include "IvSettingPresentationModel.h" +#include "IvTypes.h" using namespace Tizen::App; using namespace Tizen::Base; using namespace Tizen::Io; const wchar_t* GALLERY_APP_ID = L"ijudt7w61q.Gallery"; -const wchar_t* PATH_DATA_DIRECTORY = L"data/"; const wchar_t* PATH_GALLERY_SETTINGS = L"GalleryDefaultSettings.ini"; const wchar_t* SECTION_GALLERY = L"GALLRY_SETTING"; diff --git a/src/IvTypes.cpp b/src/IvTypes.cpp index 0b6f41d..9b42da1 100644 --- a/src/IvTypes.cpp +++ b/src/IvTypes.cpp @@ -81,6 +81,7 @@ const wchar_t* SETTING_VALUE_HOME_SCREEN_WALLPAPER = L"http://tizen.org/setting/ const wchar_t* SETTING_VALUE_LOCK_SCREEN_WALLPAPER = L"http://tizen.org/setting/screen.wallpaper.lock"; const wchar_t* FOLDER_PATH_DOWNLOADS = L"Downloads/"; +const wchar_t* PATH_DATA_DIRECTORY = L"data/"; const wchar_t* TEMP_FILE_PATH_HOME_SCREEN_WALLPAPER = L"home.jpg"; const wchar_t* TEMP_FILE_PATH_LOCK_SCREEN_WALLPAPER = L"lock.jpg";