NABI_SE issues resolved
authorchitta.rs <chitta.rs@samsung.com>
Mon, 22 Apr 2013 12:43:58 +0000 (18:13 +0530)
committerchitta.rs <chitta.rs@samsung.com>
Mon, 22 Apr 2013 12:43:58 +0000 (18:13 +0530)
Change-Id: I08e1b1130ba22ae048e6eabb30bcc9de998cfb94

inc/MfCategorySearch.h
inc/MfSearchForm.h
inc/MfSubBaseFolderEntryForm.h
inc/MfSubFolderFileListForm.h
src/MfCategorySearch.cpp
src/MfSearchForm.cpp
src/MfSubBaseFileManageForm.cpp
src/MfSubBaseFolderEntryForm.cpp
src/MfSubFolderFileListForm.cpp

index 2c9a408..39021d6 100644 (file)
@@ -38,6 +38,7 @@ public:
        virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);
 
        void OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state);
+       void OnAppControlCompleted(void);
 private:
        void GetParentFolderPath(Tizen::Base::String* filePath);
        void GetFileName(Tizen::Base::String* fileName);
index 50cdae4..1848192 100644 (file)
@@ -123,9 +123,6 @@ public:
        //IDeviceEventListener\r
        virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);\r
 \r
-       //IDeviceNotificationListener\r
-       void OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state);\r
-\r
        //IFileEventListener\r
        virtual void OnFileEventOccured(const unsigned long events,const Tizen::Base::String &  path, const unsigned int        eventId);\r
 \r
index 7c4fb77..9ae17bc 100644 (file)
@@ -99,7 +99,7 @@ public:
         * @return No Return Values.
         */
        virtual void OnThumbnailReceived(ThumbRequest* pThumbReq);
-       void OnAppControlCompleted(void){}
+       void OnAppControlCompleted(void);
 
        /*! @fn OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status)
         * @brief Called when the state of an element in the ListContextItem is changed.
@@ -589,6 +589,7 @@ protected:
 
        bool _bIsTopLevelDirectory;
        bool _bIsDirectoryEmpty;
+       bool _bBackFromAppControl;
 
        MemoryType _storageType;
 
index c376b16..7991032 100644 (file)
@@ -119,6 +119,7 @@ public:
 
        //IContentScanListener
        virtual void OnContentScanCompleted (RequestId reqId, const Tizen::Base::String &scanPath, result r);
+       void OnAppControlCompleted(void);
 
 private:
        /*
index 5ff0714..9d4be0c 100644 (file)
@@ -561,54 +561,22 @@ CategorySearch::GetFileName(Tizen::Base::String* fileName)
 void
 CategorySearch::OnFileEventOccured(const unsigned long events,const Tizen::Base::String &  path, const unsigned int    eventId)
 {
-       /*if ((events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_TO) || (events & FILE_EVENT_TYPE_MOVED_FROM))
-       {
-               if (_pFolderEntryPM!=null)
-               {
-                       _pFolderEntryPM->RefreshFolderEntries();
-               }
-               if (_pListView != null && _pListView->IsVisible())
-               {
-                       _pListView->UpdateList();
-               }
-               if (_pIconListView != null && _pIconListView->IsVisible())
-               {
-                       _pIconListView->UpdateList();
-               }
-               if (_pFolderEntryPM!=null)
-               {
-                       _pFolderEntryPM->InitThumbnailManager();
-               }
-       }*/
-
-
        AppLogDebug("TopMostFolderFileListForm::OnFileEventOccured:%S", path.GetPointer());
 
        //Scan the directory
 
-       static unsigned short bRotate = 0;
        HashMap* pCacheList = null;
        DirectoryEntry* pCurrentEntry = null;
        bool cacheKeyStatus = false;
        String cachePath;
 
-       if( !(bRotate ^ 3) )
-               bRotate = 0;
        AppLogDebug("ContentManager::ScanFile:%S", path.GetPointer());
 
        if ((events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM) || (events & FILE_EVENT_TYPE_MOVED_TO ))
        {
-               if ( (events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_MOVED_TO) )
-               {
-                       if ( bRotate & 1)
-                               bRotate |= 2;
-                       AppLogDebug("Items were rotated afted creation: %d", bRotate);
-               }
+               _bBackFromAppControl = true;
                if ( (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM))
                {
-                       bRotate |= 1;
-                       AppLogDebug("Items were rotated after deletion: %d", bRotate);
-
                        AppLogDebug("Items to delete: %d", _indexTracker);
                        pCacheList = CacheManager::GetInstance()->GetCacheHashMap();
                        if (pCacheList != null)
@@ -619,9 +587,7 @@ CategorySearch::OnFileEventOccured(const unsigned long events,const Tizen::Base:
                                {
                                        cachePath = pCurrentEntry->GetFullFilePath();
                                }
-
                                cacheKeyStatus = pCacheList->ContainsKey(cachePath);
-
                                if (cacheKeyStatus)
                                {
                                        CacheManager::GetInstance()->RemoveCacheEntry(cachePath);
@@ -632,29 +598,6 @@ CategorySearch::OnFileEventOccured(const unsigned long events,const Tizen::Base:
                {
                        _pFolderEntryPM->RefreshFolderEntries();
                }
-
-               if (_pListView != null && _pListView->IsVisible())
-               {
-                       _pListView->UpdateList();
-               }
-
-               if (_pIconListView != null && _pIconListView->IsVisible())
-               {
-                       _pIconListView->UpdateList();
-               }
-
-               if (_pFolderEntryPM!=null)
-               {
-                       if (!(bRotate ^ 3) )
-                        {
-                                {
-                                        AppLogDebug("Items were rotated : %d", bRotate);
-                                        //CacheManager::GetInstance()->ClearCache();
-                                }
-                        }
-                       /* AppLogDebug("InitThumbnailManager");
-                       _pFolderEntryPM->InitThumbnailManager();*/
-               }
        }
 
 }
@@ -877,34 +820,37 @@ CategorySearch::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const
 void
 CategorySearch::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)
 {
-       
-       
-               if (_pFolderEntryPM != null)
-               {
-                       _pFolderEntryPM->CreateTraversalTree();
-                       _pFilenames = _pFolderEntryPM->GetFolderEntryList();
-               }
+       if (_pFolderEntryPM != null)
+       {
+               _pFolderEntryPM->CreateTraversalTree();
+               _pFilenames = _pFolderEntryPM->GetFolderEntryList();
+       }
 
-               if (_pFilenames != null)
+       if (_pFilenames != null)
+       {
+               if (_pFilenames->GetCount() == 0)
                {
-                       if (_pFilenames->GetCount() == 0)
-                       {
-                               SetFooterItemsVisibility(DISABLE_FOOTER_ITEM);
-                       }
-                       else
-                       {
-                               SetFooterItemsVisibility(ENABLE_FOOTER_ITEM);
-                       }
+                       SetFooterItemsVisibility(DISABLE_FOOTER_ITEM);
                }
-
-               if (_pListView != null && _pListView->IsVisible())
+               else
                {
-                       _pListView->UpdateList();
-                       _pListView->Invalidate(true);
+                       SetFooterItemsVisibility(ENABLE_FOOTER_ITEM);
                }
+       }
 
-               if (_pFolderEntryPM != null)
-               {
-                       _pFolderEntryPM->InitThumbnailManager();
-               }
+       if (_pListView != null && _pListView->IsVisible())
+       {
+               _pListView->UpdateList();
+               _pListView->Invalidate(true);
+       }
+
+       if (_pFolderEntryPM != null)
+       {
+               _pFolderEntryPM->InitThumbnailManager();
+       }
+}
+void
+CategorySearch::OnAppControlCompleted(void)
+{
+       SubBaseFolderEntryForm::OnAppControlCompleted();
 }
index 930738e..caca5a9 100644 (file)
@@ -1259,18 +1259,17 @@ SearchForm::LoadSubDirectoryForm(Tizen::Base::String& fullPath, Tizen::Base::Str
        result r = E_SUCCESS;
        ArrayList* pArg = null;
        SceneManager* pSceneManager = null;
-       //int storageType = -1;
 
-       if (__SelectedTab == MEMORY_TYPE_PHONE)
+       //SetStorageType
+       if (fullPath.Contains(BasePresentationModel::GetMediaPath()) == true)
        {
                FolderNavigationPresentationModel::SetStorageType(MEMORY_TYPE_PHONE);
        }
-       else if (__SelectedTab == MEMORY_TYPE_SD_CARD)
+       else if (fullPath.Contains(BasePresentationModel::GetSdCardPath()) == true)
        {
                FolderNavigationPresentationModel::SetStorageType(MEMORY_TYPE_SD_CARD);
        }
-
-
+       //SetCurrentFilePath
        FolderNavigationPresentationModel::SetCurrentFilePath(fullPath);
 
        pArg = new (std::nothrow) ArrayList();
@@ -1625,75 +1624,21 @@ SearchForm::ShowDeleteConfirmationPopup(void)
 }
 
 void
-SearchForm::OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state)
+SearchForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state)
 {
-       bool setMediaPath = false;
-       MemoryType currentMemoryType = MEMORY_TYPE_PHONE;
-       String unmounted = sdCardStatusUnmounted;
-       String removed = usbDeviceStatusRemoved;
-       String currentPath;
-       SceneManager* pSceneManager = null;
-
-       if (state == unmounted || state == removed)
-       {
-               currentPath = FolderNavigationPresentationModel::GetCurrentPath();
-               if (state == unmounted)
-               {
-                       if (currentPath.Contains(BasePresentationModel::GetSdCardPath()))
-                       {
-                               FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
-                               FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
-                               setMediaPath = true;
-                       }
-               }
-
-               if (state == removed)
-               {
-                       if (currentPath.Contains(BasePresentationModel::GetUsbPath()))
-                       {
-                               FolderNavigationPresentationModel::SetCurrentFilePath(BasePresentationModel::GetMediaPath());
-                               FolderNavigationPresentationModel::SetStorageType(currentMemoryType);
-                               setMediaPath = true;
-                       }
-               }
+       AppLogDebug("SearchForm::OnDeviceStateChanged");
 
-               if (setMediaPath)
-               {
-                       pSceneManager = SceneManager::GetInstance();
-                       if (pSceneManager != null)
-                       {
-                               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ROOT_DIRECTORY_FORM, SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null);                 }
-               }
-       }
-}
+       __pSearchBar->SetMode(__searchBarMode);
 
-void
-SearchForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state)
-{
-       ComponentType currentDeviceType;
-       switch (deviceType)
-       {
-       case StorageCard:
-       {
-               currentDeviceType = COMPONENT_TYPE_STORAGE_CARD;
-       }
-       break;
+       if (__searchText.IsEmpty() == false)
+               StartSearch();
 
-       case UsbClient:
-       {
-               currentDeviceType = COMPONENT_TYPE_USB;
-       }
-       break;
+       if (__pListView != null)
+               __pListView->UpdateList();
 
-       default:
-       {
-               //Do Nothing.
-       }
-       break;
-       }
-       OnDeviceChange(currentDeviceType, state);
 }
 
+
 void
 SearchForm::OnSceneTransitionCompleted(const Tizen::Ui::Scenes::SceneId &previousSceneId,
                const Tizen::Ui::Scenes::SceneId &currentSceneId)
@@ -1874,6 +1819,7 @@ SearchForm::GetParentFolderPath(Tizen::Base::String* filePath)
        }
 
 }
+
 void
 SearchForm::OnAppControlCompleted(void)
 {
index dd534b7..d651860 100644 (file)
@@ -531,7 +531,8 @@ SubBaseFileManageForm::SubBaseOnListViewItemStateChanged(ListView& listView, int
        int folderCount = 0;
        int itemIndex = INVALID_LIST_INDEX;
 
-       _pFolderEntryPM->GetFolderEntryCount(_currentDirectoryPath, folderCount, fileCount);
+
+       _pFolderEntryPM->GetFolderEntryCount(FolderNavigationPresentationModel::GetCurrentPath(), folderCount, fileCount);
 
        DirectoryEntry* pCheckedEntry = null;
        String selected;
index 8ddeed0..6273c66 100644 (file)
@@ -74,7 +74,7 @@ SubBaseFolderEntryForm::SubBaseFolderEntryForm(void)
 , _pMediaMetaData(null)
 , _pThumbnailItemProvider(null)
 , _pThumbnailManager(null)
-
+, _bBackFromAppControl(false)
 {
        _bIsTopLevelDirectory = false;
        _bIsDirectoryEmpty = false;
@@ -2340,3 +2340,28 @@ SubBaseFolderEntryForm::SetCurrentDirectoryFlag(bool isTopDirectory)
 {
        _bIsTopLevelDirectory = isTopDirectory;
 }
+void
+SubBaseFolderEntryForm::OnAppControlCompleted(void)
+{
+       AppLogDebug("Enter");
+
+       if( !_bBackFromAppControl )
+               return;
+
+       if (_pListView != null && _pListView->IsVisible())
+       {
+               _pListView->UpdateList();
+       }
+
+       if (_pIconListView != null && _pIconListView->IsVisible())
+       {
+               _pIconListView->UpdateList();
+       }
+
+       if (_pFolderEntryPM!=null)
+       {
+               _pFolderEntryPM->InitThumbnailManager();
+       }
+       _bBackFromAppControl = false;
+       AppLogDebug("Exit");
+}
index 759f184..a9c557e 100644 (file)
@@ -911,23 +911,10 @@ SubFolderFileListForm::ShowParentDirectoryView(void)
        //              return;
        //      }
 
-       if (_pFolderEntryPM != null)
-       {
-               _pFolderEntryPM->GetFolderEntryCount(backUpCurrentPath, folderCount, fileCount);
-       }
-
        displayPath = defaultPhoneBody;
        displayPath.Append("/");
 
        SetFooterVisibility(ENABLE_FOOTER_ITEM);
-       if (fileCount == 0)
-       {
-               _pFooter = GetFooter();
-               if (_pFooter)
-               {
-                       _pFooter->SetItemEnabled(1, false);
-               }
-       }
 
        if (backUpCurrentPath == BasePresentationModel::GetMediaPath() || backUpCurrentPath == BasePresentationModel::GetSdCardPath() || backUpCurrentPath == BasePresentationModel::GetUsbPath())
        {
@@ -949,9 +936,24 @@ SubFolderFileListForm::ShowParentDirectoryView(void)
 
                FolderNavigationPresentationModel::SetCurrentFilePath(__currentDirectoryPath);
 
+               if (_pFolderEntryPM != null)
+               {
+                       _pFolderEntryPM->GetFolderEntryCount(__currentDirectoryPath, folderCount, fileCount);
+               }
+
                SetParentDisplayPath();
                SetHeaderTitleText(ParentPath);
+               SetFooterVisibility(ENABLE_FOOTER_ITEM);
 
+               if (fileCount == 0)
+               {
+                       _pFooter = GetFooter();
+                       if (_pFooter)
+                       {
+                               _pFooter->SetItemEnabled(1, false);
+                               _pFooter->Invalidate(true);
+                       }
+               }
                //Remove the current files from the filenames list
                if (_pFolderEntryPM != null)
                {
@@ -1030,7 +1032,7 @@ SubFolderFileListForm::OnNotificationReceived(Tizen::Base::Collection::ArrayList
        break;
        }
 
-       SetFooterVisibility(DISABLE_FOOTER_ITEM);
+       //SetFooterVisibility(DISABLE_FOOTER_ITEM);
 CATCH:
        if (pArgs != null)
        {
@@ -1373,6 +1375,7 @@ SubFolderFileListForm::OnSceneTransitionCompleted (const Tizen::Ui::Scenes::Scen
                        if (_pFooter)
                        {
                                _pFooter->SetItemEnabled(1, false);
+                               _pFooter->Invalidate(true);
                        }
                }
        }
@@ -1417,50 +1420,35 @@ SubFolderFileListForm::OnFileEventOccured(const unsigned long events,const Tizen
 
        //Scan the directory
        RequestId reqId;
-       static unsigned short bRotate = 0;
        HashMap* pCacheList = null;
        DirectoryEntry* pCurrentEntry = null;
        bool cacheKeyStatus = false;
        String cachePath;
 
-       if( !(bRotate ^ 3) )
-               bRotate = 0;
-
        result r = ContentManager::ScanDirectory(__currentDirectoryPath,true,null,reqId);
        AppLogDebug("ContentManager::ScanDirectory:%s", GetErrorMessage(r));
 
        if ((events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM) || (events & FILE_EVENT_TYPE_MOVED_TO ))
        {
-               if ( (events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_MOVED_TO) )
-               {
-                       if ( bRotate & 1)
-                               bRotate |= 2;
-                       AppLogDebug("Items were rotated afted creation: %d", bRotate);
-               }
+               _bBackFromAppControl = true;
                if ( (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM))
                {
-                       bRotate |= 1;
-                        AppLogDebug("Items were rotated after deletion: %d", bRotate);
-
-                       //if (  (events & FILE_EVENT_TYPE_DELETE) )
+                       AppLogDebug("Items to delete: %d", _indexTracker);
+                       pCacheList = CacheManager::GetInstance()->GetCacheHashMap();
+                       if (pCacheList != null)
                        {
-                                AppLogDebug("Items to delete: %d", _indexTracker);
-                               pCacheList = CacheManager::GetInstance()->GetCacheHashMap();
-                               if (pCacheList != null)
-                               {
-                                       pCurrentEntry = static_cast<DirectoryEntry*>(_pFilenames->GetAt(_indexTracker));
+                               pCurrentEntry = static_cast<DirectoryEntry*>(_pFilenames->GetAt(_indexTracker));
 
-                                       if (pCurrentEntry != null)
-                                       {
-                                               cachePath = pCurrentEntry->GetFullFilePath();
-                                       }
+                               if (pCurrentEntry != null)
+                               {
+                                       cachePath = pCurrentEntry->GetFullFilePath();
+                               }
 
-                                       cacheKeyStatus = pCacheList->ContainsKey(cachePath);
+                               cacheKeyStatus = pCacheList->ContainsKey(cachePath);
 
-                                       if (cacheKeyStatus)
-                                       {
-                                               CacheManager::GetInstance()->RemoveCacheEntry(cachePath);
-                                       }
+                               if (cacheKeyStatus)
+                               {
+                                       CacheManager::GetInstance()->RemoveCacheEntry(cachePath);
                                }
                        }
                }
@@ -1481,14 +1469,6 @@ SubFolderFileListForm::OnFileEventOccured(const unsigned long events,const Tizen
 
                if (_pFolderEntryPM!=null)
                {
-                       if (!(bRotate ^ 3) )
-                        {
-                                {
-                                        AppLogDebug("Items were rotated : %d", bRotate);
-                                        //CacheManager::GetInstance()->ClearCache();                   
-                                }
-                        }
-                        AppLogDebug("InitThumbnailManager");
                        _pFolderEntryPM->InitThumbnailManager();
                }
        }
@@ -1500,3 +1480,8 @@ SubFolderFileListForm::OnContentScanCompleted (RequestId reqId, const Tizen::Bas
        AppLogDebug("Enter");
        AppLogDebug("Exit");
 }
+void
+SubFolderFileListForm::OnAppControlCompleted(void)
+{
+       SubBaseFolderEntryForm::OnAppControlCompleted();
+}