NABI_Se issues resolved
[apps/osp/MyFiles.git] / src / MfSearchForm.cpp
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();