N_SE-36744 N_SE-36750 N_SE-36754 N_SE-36743
authorravi.n2 <ravi.n2@samsung.com>
Mon, 29 Apr 2013 07:46:24 +0000 (13:16 +0530)
committerravi.n2 <ravi.n2@samsung.com>
Mon, 29 Apr 2013 07:46:24 +0000 (13:16 +0530)
Change-Id: I0050af19e83244d7d7fe8b976b56e702a34e7a74

inc/MfFolderEntryPresentationModel.h
src/MfCategorySearch.cpp
src/MfFileManageForm.cpp
src/MfFolderEntryPresentationModel.cpp

index 9835671..f443de3 100644 (file)
@@ -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_
index a787061..f1f482a 100644 (file)
@@ -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);
index 4cbabd9..686d3d2 100644 (file)
@@ -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)
                {
index 814f9be..4c7ef08 100644 (file)
@@ -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<String*>(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;
+}