videocollection/hgmyvideos/src/vcxhgmyvideosvideocopier.cpp
branchRCL_3
changeset 15 8f0df5c82986
parent 9 5294c000a26d
child 18 baf439b22ddd
equal deleted inserted replaced
14:55fa1ec415c6 15:8f0df5c82986
    90         const RArray<TInt>& aOperationTargets,
    90         const RArray<TInt>& aOperationTargets,
    91         TBool& aShowMoveAndCopySubmenu,
    91         TBool& aShowMoveAndCopySubmenu,
    92         TBool& aShowCopy,
    92         TBool& aShowCopy,
    93         TBool& aShowMove )
    93         TBool& aShowMove )
    94     {
    94     {
    95     TVcxMyVideosDownloadState dlState( EVcxMyVideosDlStateNone );
       
    96     CIptvDriveMonitor& driveMonitor = iModel.DriveMonitorL();
    95     CIptvDriveMonitor& driveMonitor = iModel.DriveMonitorL();
    97     HBufC* videoUri = NULL;
    96     HBufC* videoUri = NULL;
    98     TInt drive( 0 );
    97     TInt drive( 0 );
    99 
    98 
   100     TUint32 flags;
    99     TUint32 flags;
   101 
   100 
   102     for ( TInt i = 0; i < aOperationTargets.Count(); i++ )
   101     for ( TInt i = 0; i < aOperationTargets.Count(); i++ )
   103         {
   102         {
   104         dlState = iVideoModel.VideoDownloadState( aOperationTargets[i] );
   103         // When we found source file that can be moved/copied, we need
   105 
   104         // to also check that there is target drive that we can use.
   106         // If video is not under download, there is source file that can be moved/copied.
   105         videoUri = iVideoModel.GetVideoUri( aOperationTargets[i] ).AllocLC();
   107         if ( dlState == EVcxMyVideosDlStateNone )
   106         if ( videoUri->Length() > 0 )
   108             {
   107             {
   109             // When we found source file that can be moved/copied, we need
   108             if ( iModel.FileServerSessionL().CharToDrive( videoUri->Des()[0], drive )
   110             // to also check that there is target drive that we can use.
   109                   == KErrNone )
   111             videoUri = iVideoModel.GetVideoUri( aOperationTargets[i] ).AllocLC();
   110                 {
   112             if ( videoUri->Length() > 0 )
   111                 for ( TInt j = 0; j < driveMonitor.iAvailableDrives.Count(); j++ )
   113                 {
       
   114                 if ( iModel.FileServerSessionL().CharToDrive( videoUri->Des()[0], drive )
       
   115                       == KErrNone )
       
   116                     {
   112                     {
   117                     for ( TInt j = 0; j < driveMonitor.iAvailableDrives.Count(); j++ )
   113                     flags = driveMonitor.iAvailableDrives[j].iFlags;
       
   114 
       
   115                     if ( driveMonitor.iAvailableDrives[j].iDrive != drive &&
       
   116                             !(flags & TIptvDriveInfo::ELocked) && !(flags & TIptvDriveInfo::EMediaNotPresent) )
   118                         {
   117                         {
   119                         flags = driveMonitor.iAvailableDrives[j].iFlags;
   118                         aShowMoveAndCopySubmenu = aShowCopy = aShowMove = ETrue;
   120     
   119 
   121                         if ( driveMonitor.iAvailableDrives[j].iDrive != drive &&
   120                         // No need to continue, we know that menu can be shown.
   122                                 !(flags & TIptvDriveInfo::ELocked) && !(flags & TIptvDriveInfo::EMediaNotPresent) )
   121                         CleanupStack::PopAndDestroy( videoUri );
   123                             {
   122                         return;
   124                             aShowMoveAndCopySubmenu = aShowCopy = aShowMove = ETrue;
       
   125 
       
   126                             // No need to continue, we know that menu can be shown.
       
   127                             CleanupStack::PopAndDestroy( videoUri );
       
   128                             return;
       
   129                             }
       
   130                         }
   123                         }
   131                     }
   124                     }
   132                 }
   125                 }
   133             CleanupStack::PopAndDestroy( videoUri );
   126             }
   134             }
   127         CleanupStack::PopAndDestroy( videoUri );
   135         }
   128         }
   136     }
   129     }
   137 
   130 
   138 // ---------------------------------------------------------------------------
   131 // ---------------------------------------------------------------------------
   139 // CVcxHgMyVideosVideoCopier::MoveOrCopyL()
   132 // CVcxHgMyVideosVideoCopier::MoveOrCopyL()