Revision: 201011 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 21:15:58 +0300
branchRCL_3
changeset 12 60626d494346
parent 10 1772663c5b4e
child 13 875fd7f60fdf
Revision: 201011 Kit: 201013
filemanager/App/src/CFileManagerViewBase.cpp
filemanager/Engine/inc/CFileManagerEngine.h
filemanager/Engine/inc/CFileManagerUtils.h
filemanager/Engine/src/CFileManagerEngine.cpp
filemanager/Engine/src/CFileManagerUtils.cpp
filemanager/help/data/xhtml.zip
package_definition.xml
--- a/filemanager/App/src/CFileManagerViewBase.cpp	Mon Mar 15 12:39:38 2010 +0200
+++ b/filemanager/App/src/CFileManagerViewBase.cpp	Wed Mar 31 21:15:58 2010 +0300
@@ -1556,11 +1556,12 @@
             }
         case EFormatProcess:
             {
-            RefreshDriveInfoL();
+            TFileManagerDriveInfo drvInfo;
+            DriveInfoAtCurrentPosL( drvInfo );
             if ( aError == KErrNone )
                 {
 #ifdef RD_MULTIPLE_DRIVE
-                if ( DriveInfo().iState & TFileManagerDriveInfo::EDriveMassStorage )
+                if ( drvInfo.iState & TFileManagerDriveInfo::EDriveMassStorage )
                     {
                     FileManagerDlgUtils::ShowInfoNoteL(
                         R_QTN_FMGR_MASS_FORMAT_COMPLETED );
@@ -2197,6 +2198,11 @@
             // User cancelled rename
             aNewName.Zero();
             }
+        else
+            {
+            //file server doesn't support the space in the end of the folder/file name
+            aNewName.TrimRight();
+            }
         }
 
     if ( iActiveProcess == aOperation &&
@@ -4007,6 +4013,7 @@
             {
             pwdGiven = FileManagerDlgUtils::ShowSimplePasswordQueryL( res, oldPwd );
             }
+        
         if( pwdGiven )
             {
             ConvertCharsToPwd( oldPwd, pwd );
@@ -4023,9 +4030,19 @@
                 {
                 isDone = ETrue;
                 }
+            else if ( err == KErrAccessDenied )
+                {
+                FileManagerDlgUtils::ShowErrorNoteL( resWrong );
+                }
+            else if ( err = KErrNotReady )
+                {
+                isDone = ETrue;
+                FileManagerDlgUtils::ShowErrorNoteL( R_QTN_MEMC_NOT_AVAILABLE );
+                }
             else
                 {
-                FileManagerDlgUtils::ShowErrorNoteL( resWrong );
+                isDone = ETrue;
+                FileManagerDlgUtils::ShowErrorNoteL( R_QTN_CRITICAL_ERROR );
                 }
             }
         else
@@ -4034,6 +4051,7 @@
             isDone = ETrue;
             }
         }
+
     if ( text )
         {
         CleanupStack::PopAndDestroy( text );
--- a/filemanager/Engine/inc/CFileManagerEngine.h	Mon Mar 15 12:39:38 2010 +0200
+++ b/filemanager/Engine/inc/CFileManagerEngine.h	Wed Mar 31 21:15:58 2010 +0300
@@ -380,6 +380,14 @@
         IMPORT_C TBool IsFolder( const TInt aIndex ) const;
 
         /**
+        * Asynchronous notifies about drive added or changed
+        * @since 5.2
+        * @param aPtr Pointer to an instance of this class
+        * @return 0
+        */
+        static TInt DriveAddedOrChangeAsyncL( TAny* aPtr );
+
+        /**
         * Notifies about drive added or changed
         * @since 3.1
         */
@@ -790,6 +798,18 @@
         // Checks is current drive available
         TBool CurrentDriveAvailable();
 
+        /**
+        * Start asynchronous disk event notification timer
+        * @since 5.2
+        */
+        void StartDiskEventNotifyTimerAsyncL();
+
+        /**
+        * Stop asynchronous disk event notification timer
+        * @since 5.2
+        */
+        void StopDiskEventNotifyTimerAsync();
+
     private:
 
         // Own: General File List Model is used via this object.
@@ -890,6 +910,9 @@
         
         //Own: Whether the file was a sis type
         TBool iSisFile;
+
+        //Own: postpone disk event notification while disk refresh is ongoing
+        CPeriodic* iDelayedDiskEventNotify;
     };
 
 #endif      // CFILEMANAGERENGINE_H
--- a/filemanager/Engine/inc/CFileManagerUtils.h	Mon Mar 15 12:39:38 2010 +0200
+++ b/filemanager/Engine/inc/CFileManagerUtils.h	Wed Mar 31 21:15:58 2010 +0300
@@ -84,7 +84,7 @@
         * @param aFullPath file name with full path
         * @return ETrue if file is drm protected, EFalse if not.
         */
-        TBool IsDrmProtectedFile( const TDesC& aFullPath) const;
+        TBool IsDrmProtectedFileL( const TDesC& aFullPath ) const;
         
         /**
         * Gets the icon id of the item
--- a/filemanager/Engine/src/CFileManagerEngine.cpp	Mon Mar 15 12:39:38 2010 +0200
+++ b/filemanager/Engine/src/CFileManagerEngine.cpp	Wed Mar 31 21:15:58 2010 +0300
@@ -77,8 +77,8 @@
     0x21B2, // Downwards arrow with tip leftwards
     0, // Array terminator
 };
+const TUint KDiskEventCheckInterval = 100000; // microseconds
 
-//const TInt KMGFileArrayGranularity = 32;
 
 
 // ============================ LOCAL FUNCTIONS ================================
@@ -122,7 +122,7 @@
 // -----------------------------------------------------------------------------
 //
 CFileManagerEngine::CFileManagerEngine( RFs& aFs ) :
-		iFs( aFs ), iObserver( NULL ), iSisFile( EFalse )
+		iFs( aFs ), iObserver( NULL ), iSisFile( EFalse ),iDelayedDiskEventNotify( NULL )
     {
     FUNC_LOG
     }
@@ -222,6 +222,11 @@
     delete iUtils;
     delete iDriveName;
     delete iFeatureManager;
+    if( iDelayedDiskEventNotify != NULL )
+        {
+        iDelayedDiskEventNotify->Cancel();
+        delete iDelayedDiskEventNotify;
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -1156,6 +1161,20 @@
     }
 
 // ------------------------------------------------------------------------------
+// CFileManagerEngine::DriveAddedOrChangeAsyncL
+//
+// ------------------------------------------------------------------------------
+//
+TInt CFileManagerEngine::DriveAddedOrChangeAsyncL( TAny* aPtr )
+    {
+    static_cast<CFileManagerEngine*>( aPtr )->DriveAddedOrChangedL();
+
+    //return value will be ignored by CPeriodic that calls this function
+    //following line keeps the compiler happy
+    return 0;
+    }
+
+// ------------------------------------------------------------------------------
 // CFileManagerEngine::DriveAddedOrChangedL
 //
 // ------------------------------------------------------------------------------
@@ -1187,6 +1206,7 @@
              !iWaitDialogOn &&
              !iRefresher->IsActive() )
             {
+            StopDiskEventNotifyTimerAsync();
             TPtrC dir( iNavigator->CurrentDirectory() );
             if ( dir.Length() )
                 {
@@ -1222,6 +1242,22 @@
                     MFileManagerProcessObserver::ENotifyDisksChanged, 0 );
                 }
             }
+        else
+            {
+            if( ( iProcessObserver == NULL ) || iEmbeddedApplicationOn )
+                {
+                //Do not refresh while embedded application is running or process observer is not set
+                StopDiskEventNotifyTimerAsync();
+                }
+            else
+                {
+                if( iRefresher->IsActive() )
+                   {
+                   //start Timer and notify disk event until current disk refresh finishes
+                   StartDiskEventNotifyTimerAsyncL();
+                   }
+                }
+            }
         }
     }
 
@@ -2217,5 +2253,38 @@
     iRemovableDrvHandler->DeleteBackupsL();
     }
 
+// ---------------------------------------------------------------------------
+// CFileManagerEngine::StartDiskEventNotifyTimerAsyncL()
+// ---------------------------------------------------------------------------
+//
+void CFileManagerEngine::StartDiskEventNotifyTimerAsyncL()
+    {
+    if ( iDelayedDiskEventNotify == NULL )
+        {
+        iDelayedDiskEventNotify = CPeriodic::NewL( CActive::EPriorityStandard );
+        }
+    if ( !iDelayedDiskEventNotify->IsActive() )
+        {
+       //ignore disk event notification while timer is already active
+       iDelayedDiskEventNotify->Start( KDiskEventCheckInterval,
+           KDiskEventCheckInterval,
+           TCallBack( DriveAddedOrChangeAsyncL, this ) );
+        }
+    }
 
-//  End of File  
+// ---------------------------------------------------------------------------
+// CFileManagerEngine::StopDiskEventNotifyTimerAsync()
+// ---------------------------------------------------------------------------
+//
+void CFileManagerEngine::StopDiskEventNotifyTimerAsync()
+    {
+    if ( iDelayedDiskEventNotify != NULL )
+        {
+        iDelayedDiskEventNotify->Cancel();
+        delete iDelayedDiskEventNotify;
+        iDelayedDiskEventNotify = NULL;
+        }
+    }
+
+
+//  End of File
--- a/filemanager/Engine/src/CFileManagerUtils.cpp	Mon Mar 15 12:39:38 2010 +0200
+++ b/filemanager/Engine/src/CFileManagerUtils.cpp	Wed Mar 31 21:15:58 2010 +0300
@@ -208,7 +208,7 @@
 // CFileManagerUtils::IsDrmProtectedFile
 // -----------------------------------------------------------------------------
 //
-TBool CFileManagerUtils::IsDrmProtectedFile( const TDesC& aFullPath ) const
+TBool CFileManagerUtils::IsDrmProtectedFileL( const TDesC& aFullPath ) const
     {
     if ( !iDrmFullSupported )
         {
@@ -226,8 +226,14 @@
    
     RFile64 drmFile;
     
-    User::LeaveIfError( drmFile.Open( 
-        iFs, aFullPath, EFileRead | EFileShareReadersOrWriters ) );
+    TInt err = drmFile.Open( 
+        iFs, aFullPath, EFileRead | EFileShareReadersOrWriters );
+    if( err != KErrNone )
+        {
+        // Just assume it is not protected when we fail to open it.
+        drmFile.Close();
+        return EFalse;
+        }
     CleanupClosePushL( drmFile );
     DRM::CDrmUtility *drmCheck = DRM::CDrmUtility::NewLC();
        
@@ -355,7 +361,7 @@
             {
             fileType |= CFileManagerItemProperties::EFile;
 
-            if ( IsDrmProtectedFile( aFullPath) )
+            if ( IsDrmProtectedFileL( aFullPath) )
                 {
                 fileType |= CFileManagerItemProperties::EDrmProtected;
                 if ( IsDrmLocalDataFile( aFullPath ) )
@@ -402,7 +408,7 @@
         else
             {
             fileType |= CFileManagerItemProperties::EFile;
-            if ( IsDrmProtectedFile( aFullPath) )
+            if ( IsDrmProtectedFileL( aFullPath) )
                 {
                 fileType |= CFileManagerItemProperties::EDrmProtected;
                 }
Binary file filemanager/help/data/xhtml.zip has changed
--- a/package_definition.xml	Mon Mar 15 12:39:38 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition schema="3.0.0">
-  <package id="files" name="File Manager Apps" levels="support apps">
-    <collection id="filemanager" name="File Manager" level="apps">
-      <component id="filemanager_help" filter="s60" name="File Manager Help">
-        <unit bldFile="filemanager/help/group"/>
-      </component>
-      <component id="filemanager_build" filter="s60" name="File Manager Build">
-        <unit bldFile="filemanager/group"/>
-      </component>
-    </collection>
-    <collection id="filesystemuis" name="File System UIs" level="support">
-      <component id="memscaneng" filter="s60" name="Memory Scan Server">
-        <unit bldFile="filesystemuis/memscaneng/group"/>
-      </component>
-      <component id="memstatepopup" filter="s60" name="Memory State Popup">
-        <unit bldFile="filesystemuis/memstatepopup/group"/>
-      </component>
-    </collection>
-    <collection id="files_info" name="File Manager Apps Info" level="apps">
-      <component id="files_plat" filter="s60" name="File Manager Apps Platform Interfaces" class="api">
-        <unit bldFile="files_plat/group"/>
-      </component>
-    </collection>
-  </package>
-</SystemDefinition>