NABI_Se issues resolved
authorchitta.rs <chitta.rs@samsung.com>
Wed, 15 May 2013 13:46:16 +0000 (19:16 +0530)
committerchitta.rs <chitta.rs@samsung.com>
Wed, 15 May 2013 13:46:16 +0000 (19:16 +0530)
Change-Id: I864c397949ee1d4df3bf894a654cc079d8d33d5e

inc/MfSearchForm.h
src/MfFileManageWorkerThread.cpp
src/MfSearchForm.cpp
src/MfSubBaseFileManageForm.cpp
src/MfSubBaseFolderEntryForm.cpp
src/MfUtility.cpp

index 8e57ef6..41770d6 100644 (file)
@@ -166,6 +166,8 @@ private:
        int __selectedItemIndexForRename;\r
        int __selectedItemIndexForDelete;\r
 \r
+       int __selectedItemIndex;\r
+\r
        MemoryType __SelectedTab;\r
        MemoryType __previouFormTab;\r
 \r
index bd9b181..31e3513 100644 (file)
@@ -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);
                }
index 261fa35..ef662e3 100644 (file)
@@ -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<DirectoryEntry*>(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();
 
index 9865de5..3621c23 100644 (file)
@@ -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();
 
index f05b2a7..52c32fd 100644 (file)
@@ -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);
index 0d0390d..955a7d5 100644 (file)
@@ -59,11 +59,12 @@ MfUtility::ConvertFileSizeToString(long long int fileSize)
        String size;\r
        pAppResource = Application::GetInstance()->GetAppResource();\r
 \r
-       float preciseFileSize = fileSize / MB_DIVISOR;\r
-       if (preciseFileSize == 0)\r
+       float preciseFileSize = (float)fileSize / (float)MB_DIVISOR;\r
+\r
+       if ((int)preciseFileSize == 0.0)\r
        {\r
-               preciseFileSize = fileSize / KB_DIVISOR;\r
-               if (preciseFileSize == 0)\r
+               preciseFileSize = (float)fileSize / (float)KB_DIVISOR;\r
+               if ((int)preciseFileSize == 0)\r
                {\r
                        String bytes;\r
                        pAppResource->GetString(L"IDS_BYTES", bytes);\r