From 0214ba6256eefaaa1e53d9290f2646dc8ee4ba7c Mon Sep 17 00:00:00 2001 From: "chitta.rs" Date: Wed, 15 May 2013 19:16:16 +0530 Subject: [PATCH] NABI_Se issues resolved Change-Id: I864c397949ee1d4df3bf894a654cc079d8d33d5e --- inc/MfSearchForm.h | 2 ++ src/MfFileManageWorkerThread.cpp | 34 +++++++++++++++----------- src/MfSearchForm.cpp | 52 ++++++++++++++++++++++++++++++++++++++-- src/MfSubBaseFileManageForm.cpp | 4 ++++ src/MfSubBaseFolderEntryForm.cpp | 21 +++++++++------- src/MfUtility.cpp | 9 +++---- 6 files changed, 94 insertions(+), 28 deletions(-) diff --git a/inc/MfSearchForm.h b/inc/MfSearchForm.h index 8e57ef6..41770d6 100644 --- a/inc/MfSearchForm.h +++ b/inc/MfSearchForm.h @@ -166,6 +166,8 @@ private: int __selectedItemIndexForRename; int __selectedItemIndexForDelete; + int __selectedItemIndex; + MemoryType __SelectedTab; MemoryType __previouFormTab; diff --git a/src/MfFileManageWorkerThread.cpp b/src/MfFileManageWorkerThread.cpp index bd9b181..31e3513 100644 --- a/src/MfFileManageWorkerThread.cpp +++ b/src/MfFileManageWorkerThread.cpp @@ -1976,22 +1976,28 @@ FileManageWorkerThread::Copy(Tizen::Base::String& sourcePath, Tizen::Base::Strin TryCatch(r == E_SUCCESS,,"copy file failed"); percentage = percentage + count; + long long int x = percentageComplete; + + percentageComplete = (percentage * 100) / (toatalsize); - AppLogDebug("precentage result %lld %lld",percentageComplete,percentage); - - __fileManagingingResult = FILE_MANAGING_RESULT_CURRENT_STATUS; - pArg = new (std::nothrow) ArrayList(); - pArg->Construct(); - pFileManagingResult = new (std::nothrow) Integer(__fileManagingingResult); - pFileManagedCounter = new (std::nothrow) Integer(__fileManagedCounter); - pTotalFileCount = new (std::nothrow) Integer(__pListOfFiles->GetCount()); - pPercentageCompletion = new (std::nothrow)Integer(percentageComplete); - pArg->Add(pFileManagingResult); - pArg->Add(pFileManagedCounter); - pArg->Add(pTotalFileCount); - pArg->Add(pPercentageCompletion); - Application::GetInstance()->SendUserEvent(ID_COPY_COMPLETE, pArg); + + if(x != percentageComplete) + { + AppLogDebug("precentage result %lld %lld",percentageComplete,percentage); + __fileManagingingResult = FILE_MANAGING_RESULT_CURRENT_STATUS; + pArg = new (std::nothrow) ArrayList(); + pArg->Construct(); + pFileManagingResult = new (std::nothrow) Integer(__fileManagingingResult); + pFileManagedCounter = new (std::nothrow) Integer(__fileManagedCounter); + pTotalFileCount = new (std::nothrow) Integer(__pListOfFiles->GetCount()); + pPercentageCompletion = new (std::nothrow)Integer(percentageComplete); + pArg->Add(pFileManagingResult); + pArg->Add(pFileManagedCounter); + pArg->Add(pTotalFileCount); + pArg->Add(pPercentageCompletion); + Application::GetInstance()->SendUserEvent(ID_COPY_COMPLETE, pArg); + } count = sourceFIle.Read(byteToWrite, BUFFER_SIZE_MAX); } diff --git a/src/MfSearchForm.cpp b/src/MfSearchForm.cpp index 261fa35..ef662e3 100644 --- a/src/MfSearchForm.cpp +++ b/src/MfSearchForm.cpp @@ -395,6 +395,7 @@ SearchForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId) { DeviceManager::RemoveAllDeviceEventListeners(); + __pSearchBar->RemoveKeypadEventListener(*this); } void @@ -549,6 +550,8 @@ SearchForm::OnListViewItemStateChanged(ListView& listView, int index, int elemen } } } + + __selectedItemIndex = index; return; CATCH: @@ -766,7 +769,7 @@ SearchForm::CreateItem(int index, int itemWidth) #else contentType = ContentManagerUtil::CheckContentType(pFileDetails->GetFullFilePath()); - pCacheList = CacheManager::GetInstance()->GetCacheHashMap(); + pCacheList = CacheManager::GetInstance()->GetCacheHashMap(); if (pFileDetails->IsDirectory() == true) { @@ -1734,10 +1737,51 @@ SearchForm::StartSearch(void) void SearchForm::OnFileEventOccured(const unsigned long events,const Tizen::Base::String & path, const unsigned int eventId) { + bool cacheKeyStatus = false; + HashMap* pCacheList = null; + DirectoryEntry* pCurrentEntry = null; + + String cachePath; + + ArrayList* pCurrentList = null; + if ((events & FILE_EVENT_TYPE_CREATE) || (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM) || (events & FILE_EVENT_TYPE_MOVED_TO )) { __backFromAppControl = true; + + //changes added for Nabi issue # N_SE-38472 + if ( (events & FILE_EVENT_TYPE_DELETE) || (events & FILE_EVENT_TYPE_MOVED_FROM)) + { + pCacheList = CacheManager::GetInstance()->GetCacheHashMap(); + if (pCacheList != null) + { + if (__isSearchCompleted == false) + { + if (__isSearchStarted == true) + pCurrentList = __pSearchedContentList; + else + pCurrentList = __pContentListFromLastView; + } + else + pCurrentList = __pSearchedContentList; + + if( pCurrentList ) + { + pCurrentEntry = static_cast(pCurrentList->GetAt(__selectedItemIndex)); + if (pCurrentEntry != null) + { + cachePath = pCurrentEntry->GetFullFilePath(); + } + cacheKeyStatus = pCacheList->ContainsKey(cachePath); + if (cacheKeyStatus) + { + CacheManager::GetInstance()->RemoveCacheEntry(cachePath); + } + } + } + } } + __selectedItemIndex =-1; } void @@ -1746,7 +1790,11 @@ SearchForm::GetFolderName(void) String delim(L"/"); String token; String fullPath; - String folderName(L"Search "); + String folderName; + + AppResource::GetInstance()->GetString(L"IDS_MF_SK3_SEARCH", folderName); + + folderName.Append(L" "); fullPath = FolderNavigationPresentationModel::GetCurrentPath(); diff --git a/src/MfSubBaseFileManageForm.cpp b/src/MfSubBaseFileManageForm.cpp index 9865de5..3621c23 100644 --- a/src/MfSubBaseFileManageForm.cpp +++ b/src/MfSubBaseFileManageForm.cpp @@ -228,6 +228,8 @@ SubBaseFileManageForm::SubBaseOnActionPerformed(const Tizen::Ui::Control& source case IDA_CANCEL_DELETION: { + _isSelectAll = false; + if (_pDeleteConfirmationPopUp != null) { _pDeleteConfirmationPopUp->SetShowState(false); @@ -239,6 +241,8 @@ SubBaseFileManageForm::SubBaseOnActionPerformed(const Tizen::Ui::Control& source { HideFileProgressingPopup(); + _isSelectAll = false; + if (_pFileManager != null) _pFileManager->ForceStopWorkerThread(); diff --git a/src/MfSubBaseFolderEntryForm.cpp b/src/MfSubBaseFolderEntryForm.cpp index f05b2a7..52c32fd 100644 --- a/src/MfSubBaseFolderEntryForm.cpp +++ b/src/MfSubBaseFolderEntryForm.cpp @@ -258,6 +258,8 @@ SubBaseFolderEntryForm::CreateFooterControls(void) //Set am ActionEventListener to the Footer _pFooter->AddActionEventListener(*this); _pFooter->SetBackButton(); + _pFooter->SetItemEnabled(0, false); + _pFooter->SetItemEnabled(1, false); _pFooter->SetBackButtonEnabled(true); _pFooter->Invalidate(true); } @@ -2137,18 +2139,21 @@ SubBaseFolderEntryForm::SetFooterVisibility(void) if (folderCount ==0 && fileCount == 0) { _pFooter->SetItemEnabled(0, false); - } - else - { - _pFooter->SetItemEnabled(0, true); - } - if (fileCount == 0 ) - { _pFooter->SetItemEnabled(1, false); } else { - _pFooter->SetItemEnabled(1, true); + _pFooter->SetItemEnabled(0, true); + + if (fileCount != 0) + { + _pFooter->SetItemEnabled(1, true); + } + else + { + _pFooter->SetItemEnabled(1, false); + } + } _pFooter->Invalidate(true); diff --git a/src/MfUtility.cpp b/src/MfUtility.cpp index 0d0390d..955a7d5 100644 --- a/src/MfUtility.cpp +++ b/src/MfUtility.cpp @@ -59,11 +59,12 @@ MfUtility::ConvertFileSizeToString(long long int fileSize) String size; pAppResource = Application::GetInstance()->GetAppResource(); - float preciseFileSize = fileSize / MB_DIVISOR; - if (preciseFileSize == 0) + float preciseFileSize = (float)fileSize / (float)MB_DIVISOR; + + if ((int)preciseFileSize == 0.0) { - preciseFileSize = fileSize / KB_DIVISOR; - if (preciseFileSize == 0) + preciseFileSize = (float)fileSize / (float)KB_DIVISOR; + if ((int)preciseFileSize == 0) { String bytes; pAppResource->GetString(L"IDS_BYTES", bytes); -- 2.7.4