filemanager/App/src/CFileManagerViewBase.cpp
branchRCL_3
changeset 10 875fd7f60fdf
parent 9 60626d494346
child 11 649c558486f0
--- a/filemanager/App/src/CFileManagerViewBase.cpp	Wed Mar 31 21:15:58 2010 +0300
+++ b/filemanager/App/src/CFileManagerViewBase.cpp	Wed Apr 14 15:47:10 2010 +0300
@@ -603,8 +603,15 @@
             aMenuPane.SetItemDimmed( EFileManagerUnmarkOne, ETrue );
             }
         }
-
-    TInt files( iEngine.FilesInFolderL() );
+    TInt files( 0 );
+    if( iContainer->IsSearchFieldVisible() )
+        {
+        files = FilesCountInSearchField();
+        }
+    else
+        {
+        files = iEngine.FilesInFolderL();
+        }  
     TInt count( iContainer->ListBoxSelectionIndexesCount() );
     if ( count == files )
         {
@@ -712,7 +719,15 @@
     User::LeaveIfError( err );
     if ( ret )
         {
-        DeleteItemsL( index );
+        if( IsDriveAvailable( DriveInfo().iDrive ) )
+            {
+            DeleteItemsL( index );
+            }
+        else
+            {
+            FileManagerDlgUtils::ShowInfoNoteL( R_QTN_MEMC_NOT_AVAILABLE );
+            CheckPostponedDirectoryRefresh();
+            }
         }
     else
         {
@@ -3192,7 +3207,11 @@
 
     // Common remote drive filtering
     RemoteDriveCommonFilteringL( aMenuPane );
-    
+    if( iContainer->IsSearchFieldVisible() && 
+            !FilesCountInSearchField() )
+        {
+        aMenuPane.SetItemDimmed( EFileManagerMark, ETrue );
+        }
     if ( iContainer->ListBoxNumberOfItems() )
         {
         if ( !iContainer->ListBoxSelectionIndexesCount() )
@@ -5051,6 +5070,30 @@
     }
 
 // -----------------------------------------------------------------------------
+// CFileManagerViewBase::FilesCountInSearchField()
+// 
+// -----------------------------------------------------------------------------
+//
+TInt CFileManagerViewBase::FilesCountInSearchField()
+    {
+    TInt count = 0;
+    
+    if( iContainer->IsSearchFieldVisible() )
+        {
+        TInt listBoxIndex =0;
+        for(TInt i(0); i<iContainer->ListBoxNumberOfItems();i++ )
+            {
+            listBoxIndex = iContainer->SearchFieldToListBoxIndex( i );
+            if( !iEngine.IsFolder( listBoxIndex ) )
+                {
+                count++;
+                }
+            }
+        }
+    return count;
+    }
+
+// -----------------------------------------------------------------------------
 // CFileManagerViewBase::HandleServerAppExit
 // 
 // -----------------------------------------------------------------------------