TryCatch(__pFolderEntryPM != null, , "Content Manager not found!");
__pFolderEntryPM->Construct();
- __pSearchPopup = new (std::nothrow) Popup();
- TryCatch(__pSearchPopup != null, , "Failed to allocate memory to __pSearchPopup");
-
- r = __pSearchPopup->Construct(L"IDL_SEARCH_POPUP");
- TryCatch(r == E_SUCCESS, , "failed to construct __pPopUpPanel");
-
- __pSearchPopup->SetPropagatedKeyEventListener(this);
-
- __pLabelSearching = static_cast<Label*> (__pSearchPopup->GetControl(L"IDC_LABEL_SEARCHING"));
- TryCatch(__pLabelSearching != null, , "Failed to get __pLabelSearching");
-
- __pFolderLabel = static_cast<Label*> (__pSearchPopup->GetControl(L"IDC_LABEL_FOLDER"));
- TryCatch(__pFolderLabel != null, r = GetLastResult(), "Failed to get __pFolderLabel");
-
- __pCancelSearch = static_cast<Button*> (__pSearchPopup->GetControl(L"IDC_BUTTON_CANCEL"));
- TryCatch(__pCancelSearch != null, , "Failed to get __pCancelSearch");
-
- __pCancelSearch->SetActionId(IDA_BTN_POPUP_SEARCH_CANCEL);
- __pCancelSearch->AddActionEventListener(*this);
-
- __pSearchPopup->SetShowState(false);
-
+ r = CreateSearchPopup();
+ TryCatch(r == E_SUCCESS, , "Failed to Create SearchPopup:%s", GetErrorMessage(r));
__listViewRectangle.SetBounds(X_DEFAULT, H_SEARCH_BAR, GetClientAreaBounds().width, GetClientAreaBounds().height - H_SEARCH_BAR);
}
result
+SearchForm::CreateSearchPopup(void)
+{
+ result r = E_FAILURE;
+
+ __pSearchPopup = new (std::nothrow) Popup();
+ TryCatch(__pSearchPopup != null, r = GetLastResult(), "Failed to allocate memory to __pSearchPopup");
+
+ r = __pSearchPopup->Construct(L"IDL_SEARCH_POPUP");
+ TryCatch(r == E_SUCCESS, , "failed to construct __pPopUpPanel");
+
+ __pSearchPopup->SetPropagatedKeyEventListener(this);
+
+ __pLabelSearching = static_cast<Label*> (__pSearchPopup->GetControl(L"IDC_LABEL_SEARCHING"));
+ TryCatch(__pLabelSearching != null, r = GetLastResult(), "Failed to get __pLabelSearching");
+
+ __pFolderLabel = static_cast<Label*> (__pSearchPopup->GetControl(L"IDC_LABEL_FOLDER"));
+ TryCatch(__pFolderLabel != null, r = GetLastResult(), "Failed to get __pFolderLabel");
+
+ __pCancelSearch = static_cast<Button*> (__pSearchPopup->GetControl(L"IDC_BUTTON_CANCEL"));
+ TryCatch(__pCancelSearch != null, r = GetLastResult(), "Failed to get __pCancelSearch");
+
+ __pCancelSearch->SetActionId(IDA_BTN_POPUP_SEARCH_CANCEL);
+ __pCancelSearch->AddActionEventListener(*this);
+
+ __pSearchPopup->SetShowState(false);
+
+ return r;
+
+CATCH:
+ if (__pSearchPopup != null)
+ {
+ delete __pSearchPopup;
+ __pSearchPopup = null;
+ }
+ return r;
+}
+result
SearchForm::OnTerminating(void)
{
result r = E_SUCCESS;
void
SearchForm::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction)
{
- AppLogDebug("Enter:SearchForm::OnKeypadActionPerformed");
+ AppLogDebug("Enter:SearchForm::OnKeypadActionPerformed:%S", __searchText.GetPointer());
int modalResult = 0;
String emptySearchString;
__searchBarMode = SEARCH_BAR_MODE_NORMAL;
__pSearchBar->SetMode(__searchBarMode);
__pSearchBar->HideKeypad();
-
- __pSearchPopup->SetShowState(false);
__pSearchBar->SetEnabled(true);
__pSearchBar->SetText(__searchText);
SearchForm::OnTextValueChangeCanceled(const Tizen::Ui::Control& source)
{
AppLogDebug("ENTER::SearchForm::OnTextValueChangeCanceled");
- if (__pSearchPopup->GetShowState() == true)
+ if (__pSearchPopup != null && __pSearchPopup->GetShowState() == true)
{
__pSearchPopup->SetShowState(false);
- __pSearchBar->SetEnabled(true);
+ delete __pSearchPopup;
+ __pSearchPopup = null;
}
+ __pSearchBar->SetEnabled(true);
}
void
if (__pSearchPopup != null)
{
__pSearchPopup->SetShowState(false);
+ delete __pSearchPopup;
+ __pSearchPopup = null;
}
}
}
void
SearchForm::OnNotificationReceived(Tizen::Base::Collection::ArrayList* pArgs)
{
- AppLogDebug("ENTER::SearchForm::GetCurrentFileControl");
+ AppLogDebug("ENTER::SearchForm::OnNotificationReceived");
result r = E_FAILURE;
Integer* pEventType = null;
DirectoryEntry* pResultDirEntry = null;
bool cacheKeyStatus = false;
String cachePath;
- TryCatch(pArgs != null, , "SearchForm::GetCurrentFileControl::pArg is null");
+ TryCatch(pArgs != null, , "SearchForm::OnNotificationReceived::pArg is null");
pEventType = static_cast< Integer* >(pArgs->GetAt(0));
- TryCatch(pEventType != null, , "SearchForm::GetCurrentFileControl::pArg is null");
+ TryCatch(pEventType != null, , "SearchForm::OnNotificationReceived::pArg is null");
switch (pEventType->ToInt())
{
case ID_FOLDER_SEARCH_STARTED:
{
+ AppLogDebug("ENTER::SearchForm::OnNotificationReceived:ID_FOLDER_SEARCH_STARTED");
String* pFolderSearchResult = (String*) pArgs->GetAt(1);
- TryCatch(pFolderSearchResult != null, , "SearchForm::GetCurrentFileControl::folderSearchResult is null");
+ TryCatch(pFolderSearchResult != null, , "SearchForm::OnNotificationReceived::folderSearchResult is null");
String defMediaPath(L"/opt/usr/media");
String defSdCardPath(L"/opt/storage/sdcard");
case ID_SEARCH_COMPLETED:
{
+ AppLogDebug("ENTER::SearchForm::OnNotificationReceived:ID_SEARCH_COMPLETED");
+
__isSearchCompleted = true;
- __pSearchPopup->SetShowState(false);
+ if (__pSearchPopup != null)
+ {
+ __pSearchPopup->SetShowState(false);
+ delete __pSearchPopup;
+ __pSearchPopup = null;
+ }
+
__pSearchBar->SetEnabled(true);
if (__pSearchBar->GetMode() == SEARCH_BAR_MODE_INPUT)
case ID_SEARCH_RESULT_FOUND:
{
+ AppLogDebug("ENTER::SearchForm::OnNotificationReceived:ID_SEARCH_RESULT_FOUND");
+
__isSearchCompleted = false;
__searchItemIndex++;
__itemCount++;
case FILE_MANAGING_RESULT_DELETING_SUCCESS:
{
+ AppLogDebug("ENTER::SearchForm::OnNotificationReceived:FILE_MANAGING_RESULT_DELETING_SUCCESS");
+
HideFileProgressingPopup();
pCacheList = CacheManager::GetInstance()->GetCacheHashMap();
CacheManager::GetInstance()->RemoveCacheEntry(cachePath);
}
}
- __pSearchedContentList->RemoveAt(__selectedItemIndexForDelete, true);
+ if (pCurrentEntry->IsDirectory() == false)
+ __pSearchedContentList->RemoveAt(__selectedItemIndexForDelete, true);
}
else
{
CacheManager::GetInstance()->RemoveCacheEntry(cachePath);
}
}
- __pContentListFromLastView->RemoveAt(__selectedItemIndexForDelete, false);
+ if (pCurrentEntry->IsDirectory() == false)
+ __pContentListFromLastView->RemoveAt(__selectedItemIndexForDelete, false);
+ }
+ if (pCurrentEntry->IsDirectory() == true)
+ {
+ SceneManager::GetInstance()->GoBackward(BackwardSceneTransition());
}
- if (__pListView != null)
+ else
{
- __pListView->UpdateList();
+ if (__pListView != null)
+ {
+ __pListView->UpdateList();
+ }
}
}
break;
delete pArgs;
pArgs = null;
- AppLogDebug("EXIT::SearchForm::GetCurrentFileControl");
+ AppLogDebug("EXIT::SearchForm::OnNotificationReceived");
return;
CATCH:
- AppLogDebug("EXIT::SearchForm::GetCurrentFileControl");
+ AppLogDebug("EXIT::SearchForm::OnNotificationReceived");
return;
}
String searchtext;
String folderToSearch;
String topLevelPath;
+ result r = E_FAILURE;
//Hide keypad of Search bar
__pSearchBar->HideKeypad();
__pSearchBar->SetEnabled(false);
__pSearchBar->SetMode(__searchBarMode);
+ if (__pSearchPopup == null)
+ {
+ r = CreateSearchPopup();
+ TryReturn(r == E_SUCCESS, , "Failed to create Search Popup");
+ }
//Show Popup if Application is in FOREGROUND
if ( Application::GetInstance()->GetAppUiState() == APP_UI_STATE_FOREGROUND)
{
__pSearchBar->SetMode(__searchBarMode);
__pSearchBar->HideKeypad();
- __pSearchPopup->SetShowState(false);
+ if (__pSearchPopup != null)
+ {
+ __pSearchPopup->SetShowState(false);
+ delete __pSearchPopup;
+ __pSearchPopup = null;
+ }
+
__pSearchBar->SetEnabled(true);
__pSearchBar->SetText(__searchText);
}