From b7c4c642a644f1408102325d992523ca70a49bee Mon Sep 17 00:00:00 2001 From: "ravi.n2" Date: Mon, 29 Apr 2013 13:16:24 +0530 Subject: [PATCH] N_SE-36744 N_SE-36750 N_SE-36754 N_SE-36743 Change-Id: I0050af19e83244d7d7fe8b976b56e702a34e7a74 --- inc/MfFolderEntryPresentationModel.h | 2 ++ src/MfCategorySearch.cpp | 4 ++++ src/MfFileManageForm.cpp | 12 ++++++++++++ src/MfFolderEntryPresentationModel.cpp | 9 +++++++++ 4 files changed, 27 insertions(+) diff --git a/inc/MfFolderEntryPresentationModel.h b/inc/MfFolderEntryPresentationModel.h index 9835671..f443de3 100644 --- a/inc/MfFolderEntryPresentationModel.h +++ b/inc/MfFolderEntryPresentationModel.h @@ -216,6 +216,7 @@ public: void CreateStack(void); void CreateTraversalTree(void); + int GetDeviceListCount(void); private: /*@fn FileListPresentationModel() * Copy Constructor for the FileListPresentationModel class @@ -284,6 +285,7 @@ private: ThumbnailManager* __pThumbnailManager; Tizen::Base::Collection::Stack* __pFolderEntryStack; CacheManager* __pCacheManager; + int __deviceListCount; }; #endif // _MF_FOLDER_ENTRY_PRESENTATION_MODEL_H_ diff --git a/src/MfCategorySearch.cpp b/src/MfCategorySearch.cpp index a787061..f1f482a 100644 --- a/src/MfCategorySearch.cpp +++ b/src/MfCategorySearch.cpp @@ -26,6 +26,8 @@ CategorySearch::CategorySearch(void) CategorySearch::~CategorySearch(void) { + DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this); + if (__pHomeButton != null) { delete __pHomeButton; @@ -400,6 +402,8 @@ CategorySearch::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentScen if(_pFileEventManager != null) _pFileEventManager->RemovePath(_pathOfSelectedFile); + DeviceManager::RemoveAllDeviceEventListeners(); + if (_pIconListView != null) { _pIconListView->RemoveGestureDetector(*_pLongPressGestureDetector); diff --git a/src/MfFileManageForm.cpp b/src/MfFileManageForm.cpp index 4cbabd9..686d3d2 100644 --- a/src/MfFileManageForm.cpp +++ b/src/MfFileManageForm.cpp @@ -486,6 +486,18 @@ FileManageForm::OnDeviceChange(ComponentType deviceType, const Tizen::Base::Stri if (state == unmounted || state == removed) { + if (_previousSceneId == IDSCN_CATEGORY_SEARCH_FORM) + { + if (_pFolderEntryPM != null) + { + if (_pFolderEntryPM->GetDeviceListCount() > 1) + { + SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT)); + return; + } + } + } + currentPath = FolderNavigationPresentationModel::GetCurrentPath(); if (state == unmounted) { diff --git a/src/MfFolderEntryPresentationModel.cpp b/src/MfFolderEntryPresentationModel.cpp index 814f9be..4c7ef08 100644 --- a/src/MfFolderEntryPresentationModel.cpp +++ b/src/MfFolderEntryPresentationModel.cpp @@ -72,6 +72,7 @@ FolderEntryPresentationModel::Construct(void) __requestId = 0; __currentRequestId = 0; + __deviceListCount = 1; __pFileEventManager = new (std::nothrow) FileEventManager(); r = __pFileEventManager->Construct(*this); @@ -1288,6 +1289,8 @@ FolderEntryPresentationModel::CreateTraversalTree(void) GetDeviceList(pDeviceList); deviceListCount = pDeviceList->GetCount(); + __deviceListCount = deviceListCount; + //currentDirectoryPath = new (std::nothrow) String(directoryPath); currentDirectoryPath = new (std::nothrow) String(*static_cast(pDeviceList->GetAt(0))); TryCatch(__pFolderEntryStack != null, , "Stack is null"); @@ -1572,3 +1575,9 @@ FolderEntryPresentationModel::GetSortFolderEntryCount(int& currentDirectoryCount currentDirectoryCount = currentCount; currentFileCount = __pFolderEntries->GetCount() - currentCount; } + +int +FolderEntryPresentationModel::GetDeviceListCount(void) +{ + return __deviceListCount; +} -- 2.7.4