{
if (appControlResult == APP_CTRL_RESULT_SUCCEEDED)
{
- String* filePath = (Tizen::Base::String*) pExtraData->GetValue(String(L"path"));
-
- // updates the file with the new image selected.
- bool bResult = ShowProfileImage(*filePath);
- if (bResult != null)
+ IMapEnumerator* pEnum = pExtraData->GetMapEnumeratorN();
+ while (pEnum->MoveNext() == E_SUCCESS)
{
- __pProfileManager->SetImagePath(*filePath);
+ String* pKey = dynamic_cast<String*>(pEnum->GetKey());
+ if (pKey->Equals(String(L"http://tizen.org/appcontrol/data/selected")))
+ {
+ // The value is IList.
+ IList* pValueList = dynamic_cast<IList*>(pEnum->GetValue());
+ if (pValueList)
+ {
+ // Use the file path
+ String* filePath = dynamic_cast<String*>(pValueList->GetAt(0));
+ // updates the file with the new image selected.
+ bool bResult = ShowProfileImage(*filePath);
+ if (bResult != null)
+ {
+ __pProfileManager->SetImagePath(*filePath);
+ }
+ }
+ }
}
+ delete pEnum;
}
}
}
void
ProfileForm::ChangeProfileImage(void)
{
- __pAppControl = AppManager::FindAppControlN(L"tizen.filemanager",
+ String mime = L"image/*";
+ HashMap extraData;
+ extraData.Construct();
+ String selectKey = L"http://tizen.org/appcontrol/data/selection_mode";
+ String selectVal = L"single";
+ extraData.Add(&selectKey, &selectVal);
+
+ __pAppControl = AppManager::FindAppControlN(L"tizen.filemanager",
L"http://tizen.org/appcontrol/operation/pick");
-
if (__pAppControl != null)
{
- HashMap* pDataList = null;
- pDataList = new (std::nothrow) HashMap();
- pDataList->Construct();
- pDataList->Add(new (std::nothrow) String(L"type"), new (std::nothrow) String(L"image"));
- pDataList->Add(new (std::nothrow) String(L"selectionType"), new (std::nothrow) String(L"single"));
-
- __pAppControl->Start(null, null, pDataList, this);
+ __pAppControl->Start(null, &mime, &extraData, this);
delete __pAppControl;
__pAppControl = null;
-
- pDataList->RemoveAll(true);
- delete pDataList;
}
}