while (pEnum->MoveNext() == E_SUCCESS)
{
String* pKey = dynamic_cast<String*>(pEnum->GetKey());
- if (pKey->Equals(String(L"http://tizen.org/appcontrol/data/selected")))
+ if (pKey != null && *pKey == L"http://tizen.org/appcontrol/data/selected")
{
IList* pValueList = dynamic_cast<IList*>(pEnum->GetValue());
if (pValueList)
{
- for (int i = 0; i < pValueList->GetCount(); i++)
+ String dstPath = Application::GetInstance()->GetAppDataPath();
+ String srcPath = L"";
+ String srcFileExtention = L"";
+ String* pSrcPath = dynamic_cast<String*>(pValueList->GetAt(0));
+ if (pSrcPath != null)
{
- String dstPath = Application::GetInstance()->GetAppDataPath();
- String srcPath = *dynamic_cast<String*>(pValueList->GetAt(i));
- String srcFileExtention = File::GetFileExtension(srcPath);
+ srcPath = *pSrcPath;
+ }
+ if (srcPath.IsEmpty() == false)
+ {
+ srcFileExtention = File::GetFileExtension(srcPath);
+ }
+
+ switch (argIndex)
+ {
+ case 0:
+ {
+ dstPath.Append(L"/home.");
+ dstPath.Append(srcFileExtention);
+ File::Copy(srcPath, dstPath, false);
- switch (argIndex)
+ if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN, dstPath) != E_SUCCESS)
{
- case 0:
- {
- dstPath.Append(L"/home.");
- dstPath.Append(srcFileExtention);
- File::Copy(srcPath, dstPath, false);
-
- if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN, dstPath) != E_SUCCESS)
- {
- AppLogDebug("Wallpapaer Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
- }
- }
- break;
+ AppLogDebug("Wallpaper Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
+ }
+ }
+ break;
- case 1:
- {
- dstPath.Append(L"/lock.");
- dstPath.Append(srcFileExtention);
- File::Copy(srcPath, dstPath, false);
-
- if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN_LOCK, dstPath) != E_SUCCESS)
- {
- AppLogDebug("Wallpapaer Lock Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
- }
- }
- break;
+ case 1:
+ {
+ dstPath.Append(L"/lock.");
+ dstPath.Append(srcFileExtention);
+ File::Copy(srcPath, dstPath, false);
- case 2:
- {
- dstPath.Append(L"/homelock.");
- dstPath.Append(srcFileExtention);
- File::Copy(srcPath, dstPath, false);
-
- if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN, dstPath) != E_SUCCESS)
- {
- AppLogDebug("Wallpapaer Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
- }
-
- if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN_LOCK, dstPath) != E_SUCCESS)
- {
- AppLogDebug("Wallpapaer Lock Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
- }
- }
- break;
+ if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN_LOCK, dstPath) != E_SUCCESS)
+ {
+ AppLogDebug("Wallpaper Lock Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
+ }
+ }
+ break;
+
+ case 2:
+ {
+ dstPath.Append(L"/homelock.");
+ dstPath.Append(srcFileExtention);
+ File::Copy(srcPath, dstPath, false);
- default:
- break;
+ if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN, dstPath) != E_SUCCESS)
+ {
+ AppLogDebug("Wallpaper Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
}
- SceneManager* pSceneManager = SceneManager::GetInstance();
- AppAssert(pSceneManager);
- IListT<SceneId>* sceneList = pSceneManager->GetSceneHistoryN();
- pSceneManager->ClearSceneHistory();
- int sceneIndex = 0;
- while (sceneIndex < sceneList->GetCount())
+
+ if (SettingInfo::SetValue(RUNTIME_INFO_KEY_WALLPAPER_SCREEN_LOCK, dstPath) != E_SUCCESS)
{
- String* pSceneId = new (std::nothrow) String();
- sceneList->GetAt(sceneIndex++, *pSceneId);
- if (pSceneId->Equals(IDSCN_WALLPAPER_ALBUM_LIST, true) == true)
+ AppLogDebug("Wallpaper Lock Screen SetValue is Fail [%s]", GetErrorMessage(GetLastResult()));
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ AppAssert(pSceneManager);
+ IListT<SceneId>* sceneList = pSceneManager->GetSceneHistoryN();
+ pSceneManager->ClearSceneHistory();
+ int sceneIndex = 0;
+ while (sceneIndex < sceneList->GetCount())
+ {
+ String* pSceneId = new (std::nothrow) String();
+ sceneList->GetAt(sceneIndex++, *pSceneId);
+ if (pSceneId->Equals(IDSCN_WALLPAPER_ALBUM_LIST, true) == true)
+ {
+ if (pSceneManager->IsSceneAlive(*pSceneId) == true)
{
- if (pSceneManager->IsSceneAlive(*pSceneId) == true)
- {
- pSceneManager->DestroyScene(*pSceneId);
- }
- delete pSceneId;
- continue;
+ pSceneManager->DestroyScene(*pSceneId);
}
-
- pSceneManager->AddToSceneHistory(*pSceneId);
delete pSceneId;
+ continue;
}
- pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
+
+ pSceneManager->AddToSceneHistory(*pSceneId);
+ delete pSceneId;
}
+ pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), null);
}
}
}
pAlbumPathList->Add(*(new (std::nothrow) String(pAlbumInfo->GetDirectory(i))));
}
__pAlbumPathList = pAlbumPathList;
-}
\ No newline at end of file
+}