contentstorage/casrv/causifscanner/src/causifscanner.cpp
changeset 125 26079c1bb561
parent 119 50e220be30d1
equal deleted inserted replaced
123:d1dadafc5584 125:26079c1bb561
    16  */
    16  */
    17 
    17 
    18 #include <e32property.h>
    18 #include <e32property.h>
    19 #include <f32file.h>
    19 #include <f32file.h>
    20 #include <badesca.h>
    20 #include <badesca.h>
       
    21 #include <driveinfo.h>
    21 
    22 
    22 #include "causifscanner.h"
    23 #include "causifscanner.h"
    23 #include "cainnerentry.h"
    24 #include "cainnerentry.h"
    24 #include "cainnerquery.h"
    25 #include "cainnerquery.h"
    25 #include "cadef.h"
    26 #include "cadef.h"
   160         aCaEntry->SetFlags( EVisible );
   161         aCaEntry->SetFlags( EVisible );
   161         }
   162         }
   162     if( aEntry->IsRemovable() )
   163     if( aEntry->IsRemovable() )
   163         {
   164         {
   164         aCaEntry->SetFlags( aCaEntry->GetFlags() | ERemovable );
   165         aCaEntry->SetFlags( aCaEntry->GetFlags() | ERemovable );
   165         }
   166         
       
   167         TChar drive;
       
   168         RBuf drives;        
       
   169         drives.CreateL(KMaxFileName);
       
   170         CleanupClosePushL( drives );
       
   171         const TInt driveListLen(aEntry->InstalledDrives().Length());
       
   172         for (TInt i( 0 ); i < driveListLen; ++i) 
       
   173             {
       
   174             // Skip PhoneMemory and if we have some icon resolved
       
   175             if (aEntry->InstalledDrives()[i] != '\0' && drives.Length() == 0
       
   176                     && (DriveInfo::GetDefaultDrive(
       
   177                             DriveInfo::EDefaultPhoneMemory, drive ) == KErrNone
       
   178                             && TChar('A'+ i) != TChar(drive)))
       
   179                 {
       
   180                 TUint drvStatus( 0 );
       
   181                 int err = DriveInfo::GetDriveStatus( iFs, i, drvStatus );
       
   182                 if ( ( drvStatus & DriveInfo::EDriveInternal ) &&
       
   183                      ( drvStatus & DriveInfo::EDriveExternallyMountable ) ){
       
   184                     // Mass Storage
       
   185                     drives.Append(_L("qtg_mono_hard_disk"));
       
   186                     }
       
   187                 else if(drvStatus & DriveInfo::EDriveRemote ||
       
   188                         drvStatus & DriveInfo::EDriveUsbMemory)
       
   189                     {
       
   190                     // Usb or remote drive
       
   191                     drives.Append(_L("qtg_mono_usb"));
       
   192                     }
       
   193                 else if( ( drvStatus & DriveInfo::EDriveRemovable ) &&
       
   194                      ( drvStatus & DriveInfo::EDriveExternallyMountable ) )
       
   195                     {
       
   196                     // MMC
       
   197                     drives.Append(_L("qtg_mono_memory_in_use"));
       
   198                     }
       
   199                 }
       
   200             }
       
   201         if (drives.Length() > 0) {
       
   202             aCaEntry->AddAttributeL( KCaAttrDrivesIconIds, drives );
       
   203         }
       
   204         CleanupStack::PopAndDestroy( &drives );
       
   205         }
       
   206 
       
   207     
   166     // entries obtained with usif should have component id.
   208     // entries obtained with usif should have component id.
   167     //it's needed for uninstalling
   209     //it's needed for uninstalling
   168     RBuf compIdDesc;
   210     RBuf compIdDesc;
   169     CleanupClosePushL( compIdDesc );
   211     CleanupClosePushL( compIdDesc );
   170     compIdDesc.CreateL( KCaMaxAttrValueLen );
   212     compIdDesc.CreateL( KCaMaxAttrValueLen );
   365         entriesId.Append( aCaArray[i]->GetId() );
   407         entriesId.Append( aCaArray[i]->GetId() );
   366         }
   408         }
   367     iStorageProxy.RemoveL( entriesId );
   409     iStorageProxy.RemoveL( entriesId );
   368     CleanupStack::PopAndDestroy( &entriesId );
   410     CleanupStack::PopAndDestroy( &entriesId );
   369     }
   411     }
       
   412