Revision: 201017 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 11 May 2010 16:01:48 +0300
branchRCL_3
changeset 13 5181328fad28
parent 11 649c558486f0
child 14 efe289f793e7
Revision: 201017 Kit: 201019
filemanager/App/src/CFileManagerMainView.cpp
filemanager/Engine/src/CFileManagerEngine.cpp
filemanager/Engine/src/CFileManagerRemovableDriveHandler.cpp
filemanager/Engine/src/CFileManagerRestoreSettingsFull.cpp
filemanager/GFLM/inc/CGflmFileRecognizer.h
filemanager/GFLM/src/CGflmFileRecognizer.cpp
filemanager/View/src/CFileManagerFileNameQueryDlg.cpp
filemanager/bkupengine/inc/CMMCScBkupEngineImpl.h
filemanager/bkupengine/src/CMMCScBkupDriveDataSizeManager.cpp
filemanager/bkupengine/src/CMMCScBkupEngineImpl.cpp
filesystemuis/memscaneng/data/mseng.rss
filesystemuis/memscaneng/group/memscanserv.mmp
filesystemuis/memscaneng/serverinc/mseng.h
filesystemuis/memscaneng/serverinc/mseng.hrh
filesystemuis/memscaneng/serversrc/mseng.cpp
--- a/filemanager/App/src/CFileManagerMainView.cpp	Tue Apr 27 16:25:17 2010 +0300
+++ b/filemanager/App/src/CFileManagerMainView.cpp	Tue May 11 16:01:48 2010 +0300
@@ -781,8 +781,6 @@
         return;
         }
     RenameDriveL( EFalse );
-    iEngine.SetObserver( this );
-    iEngine.RefreshDirectory();
     }
 
 // ------------------------------------------------------------------------------
--- a/filemanager/Engine/src/CFileManagerEngine.cpp	Tue Apr 27 16:25:17 2010 +0300
+++ b/filemanager/Engine/src/CFileManagerEngine.cpp	Tue May 11 16:01:48 2010 +0300
@@ -859,14 +859,16 @@
     const TUint16 KMinAllowedChar = 0x0020;
     const TUint16 KParagraphSeparator = 0x2029;
     const TUint16 KDot = '.';
-    TInt nameLen( aName.Length() );
+    TFileName nameAfterTrim( aName );
+    nameAfterTrim.TrimRight(); 
+    TInt nameLen( nameAfterTrim.Length() );
     if ( !nameLen )
         {
         return EFalse;
         }
     for ( TInt i( 0 ); i < nameLen; i++ )
         {
-        TUint16 ch( aName[ i ] );
+        TUint16 ch( nameAfterTrim[ i ] );
         if ( ch < KMinAllowedChar || ch == KParagraphSeparator )
             {
             return EFalse;
@@ -874,7 +876,7 @@
         }
     // File system ignores totally dot in the end of name, so 
     // we set here as not valid name, so that user gets correctly informed
-    if ( aName[ nameLen - 1 ] == KDot || IllegalChars( aName ) )
+    if ( nameAfterTrim[ nameLen - 1 ] == KDot || IllegalChars( nameAfterTrim ) )
         {
         return EFalse;
         }
@@ -907,7 +909,7 @@
             TPtr ptr( fullPath->Des() );
             ptr.Copy( pathPtr );
             CFileManagerUtils::EnsureFinalBackslash( ptr ); // Add backslash before name
-            ptr.Append( aName );
+            ptr.Append( nameAfterTrim );
             ret = iFs.IsValidName( ptr );
             delete fullPath;
             }
--- a/filemanager/Engine/src/CFileManagerRemovableDriveHandler.cpp	Tue Apr 27 16:25:17 2010 +0300
+++ b/filemanager/Engine/src/CFileManagerRemovableDriveHandler.cpp	Tue May 11 16:01:48 2010 +0300
@@ -738,8 +738,10 @@
         RArray< CFileManagerRestoreSettings::TInfo >& aArray,
         const TInt aDrive )
     {
+    
+    CleanupClosePushL( aArray );
+    
     CFileManagerBackupSettings& settings( iEngine.BackupSettingsL() );
-
     aArray.Reset();
 
     TResourceReader driveReader;
@@ -792,6 +794,8 @@
     CleanupStack::PopAndDestroy( &tz );
     CleanupStack::PopAndDestroy( &archives );
     CleanupStack::PopAndDestroy( params );
+    CleanupStack::Pop( &aArray ) ;
+    
     }
 
 // ---------------------------------------------------------------------------
--- a/filemanager/Engine/src/CFileManagerRestoreSettingsFull.cpp	Tue Apr 27 16:25:17 2010 +0300
+++ b/filemanager/Engine/src/CFileManagerRestoreSettingsFull.cpp	Tue May 11 16:01:48 2010 +0300
@@ -233,6 +233,7 @@
 void CFileManagerRestoreSettings::GetSelectionL(
         RArray< TInfo >& aInfoArray ) const
     {
+    CleanupClosePushL( aInfoArray );
     aInfoArray.Reset();
 
     TInt count( iList.Count() );
@@ -244,6 +245,7 @@
             aInfoArray.AppendL( iList[ i ]->iInfo );
             }
         }
+    CleanupStack::Pop( &aInfoArray );
     }
 
 // ----------------------------------------------------------------------------
--- a/filemanager/GFLM/inc/CGflmFileRecognizer.h	Tue Apr 27 16:25:17 2010 +0300
+++ b/filemanager/GFLM/inc/CGflmFileRecognizer.h	Tue May 11 16:01:48 2010 +0300
@@ -138,6 +138,12 @@
         *
         */
         TPtrC DoRecognizeL( const TDesC& aFilename );
+        
+        /**
+         * Reset and Destroy the RPointArray of CExtMimePair
+         * 
+         */
+        static void ResetAndDestroyExtMimePairs( TAny* aPtr );
 
     private:    // Data
         // Own: For using the apparc recognisers
--- a/filemanager/GFLM/src/CGflmFileRecognizer.cpp	Tue Apr 27 16:25:17 2010 +0300
+++ b/filemanager/GFLM/src/CGflmFileRecognizer.cpp	Tue May 11 16:01:48 2010 +0300
@@ -96,7 +96,9 @@
         RResourceFile& aResFile,
         TInt aResId,
         RPointerArray< CExtMimePair >& aPairs )
-    {
+    {   
+    TCleanupItem cleanupItem( ResetAndDestroyExtMimePairs, &aPairs );
+    CleanupStack::PushL( cleanupItem );
     // read the pairs
     HBufC8* resData = aResFile.AllocReadLC( aResId );
     TResourceReader reader;
@@ -115,6 +117,7 @@
         CleanupStack::Pop( pair );
         }
     CleanupStack::PopAndDestroy( resData );
+    CleanupStack::Pop( &aPairs );
     }
 
 // -----------------------------------------------------------------------------
@@ -320,6 +323,21 @@
         return TPtrC( KNullDesC );
     }
 
+
+// -----------------------------------------------------------------------------
+//  CGflmFileRecognizer::ResetAndDestroyExtMimePairs( )
+// 
+// -----------------------------------------------------------------------------
+//
+void CGflmFileRecognizer::ResetAndDestroyExtMimePairs( TAny* aPtr )
+    {
+    RPointerArray< CExtMimePair >* extMimePairs = 
+        static_cast< RPointerArray< CExtMimePair >* >( aPtr );
+    extMimePairs->ResetAndDestroy();
+    extMimePairs->Close();
+    }
+ 
+ 
 // -----------------------------------------------------------------------------
 // CGflmFileRecognizer::FlushCache( )
 //
--- a/filemanager/View/src/CFileManagerFileNameQueryDlg.cpp	Tue Apr 27 16:25:17 2010 +0300
+++ b/filemanager/View/src/CFileManagerFileNameQueryDlg.cpp	Tue May 11 16:01:48 2010 +0300
@@ -102,6 +102,7 @@
 
     HBufC* userText = Text().AllocLC();
     TPtr ptrUserText( userText->Des() );
+    ptrUserText.TrimRight();
 
     // Strip any directionality markers to get pure name
     AknTextUtils::StripCharacters( ptrUserText, KFmgrDirectionalChars );
--- a/filemanager/bkupengine/inc/CMMCScBkupEngineImpl.h	Tue Apr 27 16:25:17 2010 +0300
+++ b/filemanager/bkupengine/inc/CMMCScBkupEngineImpl.h	Tue May 11 16:01:48 2010 +0300
@@ -212,9 +212,15 @@
         void ExecuteStateL();
 
         /**
-        *
+        * 
         */
         void PrepareObjectsL();
+        
+        /**
+        * Reset and Destroy the RPointArray of Archives
+        * 
+        */
+        static void ResetAndDestroyArchives( TAny* aPtr );
 
 #ifdef DEBUGGING_DATA_TRANSFER
 
--- a/filemanager/bkupengine/src/CMMCScBkupDriveDataSizeManager.cpp	Tue Apr 27 16:25:17 2010 +0300
+++ b/filemanager/bkupengine/src/CMMCScBkupDriveDataSizeManager.cpp	Tue May 11 16:01:48 2010 +0300
@@ -456,6 +456,7 @@
 // ---------------------------------------------------------------------------
 void CMMCScBkupDataTypeSizer::GetSizesL( RArray<TMMCScBkupDriveAndSize>& aSizes ) const
     {
+    CleanupClosePushL( aSizes );
     aSizes.Reset();
     //
     for( TInt d = EDriveA; d<=EDriveZ; d++ )
@@ -479,6 +480,7 @@
             aSizes.AppendL( driveAndSize );
             }
         }
+    CleanupStack::Pop( &aSizes );
     }
 
 
--- a/filemanager/bkupengine/src/CMMCScBkupEngineImpl.cpp	Tue Apr 27 16:25:17 2010 +0300
+++ b/filemanager/bkupengine/src/CMMCScBkupEngineImpl.cpp	Tue May 11 16:01:48 2010 +0300
@@ -1007,6 +1007,18 @@
     
     
 // ---------------------------------------------------------------------------
+// CMMCScBkupEngineImpl::ResetAndDestroyArchives
+// ---------------------------------------------------------------------------
+// 
+void CMMCScBkupEngineImpl::ResetAndDestroyArchives( TAny* aPtr )
+    {
+    RPointerArray< CMMCScBkupArchiveInfo >* archive = 
+        static_cast< RPointerArray< CMMCScBkupArchiveInfo >* >( aPtr );
+    archive->ResetAndDestroy();
+    archive->Close();
+    }
+
+// ---------------------------------------------------------------------------
 // CMMCScBkupEngineImpl::ListArchivesL()
 // 
 // Provide a list of valid (both content and category do match) archives 
@@ -1020,6 +1032,9 @@
     {
     __LOG("CMMCScBkupEngineImpl::ListArchivesL() - START");
 
+    TCleanupItem cleanupItem( ResetAndDestroyArchives, &aArchives );
+    CleanupStack::PushL( cleanupItem );
+    
     for(TInt i = 0; i < KMaxDrives; i++)
         {
         // Check is drive number allowed
@@ -1097,7 +1112,7 @@
             
         CleanupStack::PopAndDestroy(pFiles);
         }
-
+    CleanupStack::Pop( &aArchives );
     __LOG("CMMCScBkupEngineImpl::ListArchivesL() - END");
     }
 
--- a/filesystemuis/memscaneng/data/mseng.rss	Tue Apr 27 16:25:17 2010 +0300
+++ b/filesystemuis/memscaneng/data/mseng.rss	Tue May 11 16:01:48 2010 +0300
@@ -463,6 +463,11 @@
             exttype=EExtMxmf;
             extension="*.mxmf";
             },
+        EXTTYPEELEMENT
+            {
+            exttype=EExtMka;
+            extension="*.mka";
+            },
 
         // ---------- Java file types -----
 
@@ -527,7 +532,21 @@
             exttype=EExt3g2;
             extension="*.3g2";
             },
-
+        EXTTYPEELEMENT
+            {
+            exttype=EExtRmvb;
+            extension="*.rmvb";
+            },
+        EXTTYPEELEMENT
+            {
+            exttype=EExtMkv;
+            extension="*.mkv";
+            },
+        EXTTYPEELEMENT
+            {
+            exttype=EExtAvi;
+            extension="*.avi";
+            },
         // ---------- Document types ----------
 
         EXTTYPEELEMENT
@@ -741,7 +760,8 @@
                 EExtWma,
                 EExtM4a,
                 EExtOtt,
-                EExtMxmf
+                EExtMxmf,
+                EExtMka
                 };
             },
         DATAGROUPEXTS
@@ -775,7 +795,10 @@
                 EExtRm,
                 EExtRv,
                 EExtWmv,
-                EExt3g2
+                EExt3g2,
+                EExtRmvb,
+                EExtMkv,
+                EExtAvi
                 };
             },    
         DATAGROUPEXTS
--- a/filesystemuis/memscaneng/group/memscanserv.mmp	Tue Apr 27 16:25:17 2010 +0300
+++ b/filesystemuis/memscaneng/group/memscanserv.mmp	Tue May 11 16:01:48 2010 +0300
@@ -55,7 +55,7 @@
 LIBRARY         estor.lib
 LIBRARY         bafl.lib    // Resource files
 LIBRARY         sisregistryclient.lib
-                
+LIBRARY         platformenv.lib        
 //Uncomment this line to show the RDebug::Print()
 // MACRO __SHOW_RDEBUG_PRINT_
 
--- a/filesystemuis/memscaneng/serverinc/mseng.h	Tue Apr 27 16:25:17 2010 +0300
+++ b/filesystemuis/memscaneng/serverinc/mseng.h	Tue May 11 16:01:48 2010 +0300
@@ -132,18 +132,25 @@
         
         /**
         * Check whether internal drive.
-        * @param aDrv Drive to be chanked.
+        * @param aDrv Drive to be checked.
         * @return ETrue if internal drive, otherwise EFalse.
         */
         static TBool IsInternalDrive( RFs& aFs, const TInt aDrv );
 
         /**
         * Check whether removable drive.
-        * @param aDrv Drive to be chanked.
+        * @param aDrv Drive to be checked.
         * @return ETrue if internal drive, otherwise EFalse.
         */
         static TBool IsRemovableDrive( RFs& aFs, const TInt aDrv );
-
+       
+        /**
+        * Check whether mass storage drive.
+        * @param aDrv Drive to be checked.
+        * @return ETrue if mass storage drive, otherwise EFalse.
+        */
+        static TBool IsMassStorageDrive( RFs& aFs, const TInt aDrv );
+        
     private:
 
         /**
--- a/filesystemuis/memscaneng/serverinc/mseng.hrh	Tue Apr 27 16:25:17 2010 +0300
+++ b/filesystemuis/memscaneng/serverinc/mseng.hrh	Tue May 11 16:01:48 2010 +0300
@@ -99,6 +99,7 @@
     EExtM4a,
     EExtOtt,
     EExtMxmf,
+    EExtMka,
     // Java file types
     EExtJad,
     EExtJar,
@@ -113,6 +114,9 @@
     EExtRv,
     EExtWmv,
     EExt3g2,
+    EExtRmvb,
+    EExtMkv,
+    EExtAvi,
     // Document types
     EExtDoc,
     EExtPdf,
--- a/filesystemuis/memscaneng/serversrc/mseng.cpp	Tue Apr 27 16:25:17 2010 +0300
+++ b/filesystemuis/memscaneng/serversrc/mseng.cpp	Tue May 11 16:01:48 2010 +0300
@@ -24,6 +24,7 @@
 // SYSTEM INCLUDES
 #include    <mseng.rsg>
 #include    <bautils.h>
+#include    <driveinfo.h>
 
 // USER INCLUDES
 #include    "mseng.h"
@@ -563,5 +564,26 @@
     return ETrue;
     }
 
+// -----------------------------------------------------------------------------
+// CMseng::IsMassStorageDrive
+// -----------------------------------------------------------------------------
+//
+TBool CMseng::IsMassStorageDrive( RFs& aFs, TInt aDrv )
+    {
+    
+    TUint drvStatus( 0 );
+    TInt err( DriveInfo::GetDriveStatus( aFs, aDrv, drvStatus ) );
+    if ( err != KErrNone )
+        {
+        return EFalse;
+        }
+    
+    if ( ( drvStatus & DriveInfo::EDriveInternal ) &&
+        ( drvStatus & DriveInfo::EDriveExternallyMountable ) )
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
 
 //  End of File