From: chitta.rs Date: Mon, 22 Apr 2013 12:43:58 +0000 (+0530) Subject: NABI_SE issues resolved X-Git-Tag: accepted/tizen_2.1/20130425.024242~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=682cc464e06a0741c8b0e3c1acc1df5c5766a4ba;p=apps%2Fosp%2FMyFiles.git NABI_SE issues resolved Change-Id: I08e1b1130ba22ae048e6eabb30bcc9de998cfb94 --- diff --git a/inc/MfCategorySearch.h b/inc/MfCategorySearch.h index 2c9a408..39021d6 100644 --- a/inc/MfCategorySearch.h +++ b/inc/MfCategorySearch.h @@ -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); diff --git a/inc/MfSearchForm.h b/inc/MfSearchForm.h index 50cdae4..1848192 100644 --- a/inc/MfSearchForm.h +++ b/inc/MfSearchForm.h @@ -123,9 +123,6 @@ public: //IDeviceEventListener virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state); - //IDeviceNotificationListener - void OnDeviceChange(ComponentType deviceType, const Tizen::Base::String& state); - //IFileEventListener virtual void OnFileEventOccured(const unsigned long events,const Tizen::Base::String & path, const unsigned int eventId); diff --git a/inc/MfSubBaseFolderEntryForm.h b/inc/MfSubBaseFolderEntryForm.h index 7c4fb77..9ae17bc 100644 --- a/inc/MfSubBaseFolderEntryForm.h +++ b/inc/MfSubBaseFolderEntryForm.h @@ -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; diff --git a/inc/MfSubFolderFileListForm.h b/inc/MfSubFolderFileListForm.h index c376b16..7991032 100644 --- a/inc/MfSubFolderFileListForm.h +++ b/inc/MfSubFolderFileListForm.h @@ -119,6 +119,7 @@ public: //IContentScanListener virtual void OnContentScanCompleted (RequestId reqId, const Tizen::Base::String &scanPath, result r); + void OnAppControlCompleted(void); private: /* diff --git a/src/MfCategorySearch.cpp b/src/MfCategorySearch.cpp index 5ff0714..9d4be0c 100644 --- a/src/MfCategorySearch.cpp +++ b/src/MfCategorySearch.cpp @@ -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(); } diff --git a/src/MfSearchForm.cpp b/src/MfSearchForm.cpp index 930738e..caca5a9 100644 --- a/src/MfSearchForm.cpp +++ b/src/MfSearchForm.cpp @@ -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 ¤tSceneId) @@ -1874,6 +1819,7 @@ SearchForm::GetParentFolderPath(Tizen::Base::String* filePath) } } + void SearchForm::OnAppControlCompleted(void) { diff --git a/src/MfSubBaseFileManageForm.cpp b/src/MfSubBaseFileManageForm.cpp index dd534b7..d651860 100644 --- a/src/MfSubBaseFileManageForm.cpp +++ b/src/MfSubBaseFileManageForm.cpp @@ -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; diff --git a/src/MfSubBaseFolderEntryForm.cpp b/src/MfSubBaseFolderEntryForm.cpp index 8ddeed0..6273c66 100644 --- a/src/MfSubBaseFolderEntryForm.cpp +++ b/src/MfSubBaseFolderEntryForm.cpp @@ -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"); +} diff --git a/src/MfSubFolderFileListForm.cpp b/src/MfSubFolderFileListForm.cpp index 759f184..a9c557e 100644 --- a/src/MfSubFolderFileListForm.cpp +++ b/src/MfSubFolderFileListForm.cpp @@ -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(_pFilenames->GetAt(_indexTracker)); + pCurrentEntry = static_cast(_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(); +}