filemanager/src/filemanager/src/backuprestore/fmbackupwidget.cpp
changeset 29 b3155376f2b4
parent 21 15299bc55001
child 30 6e96d2143d46
equal deleted inserted replaced
24:1d0c87b42e2e 29:b3155376f2b4
   352 
   352 
   353 
   353 
   354 void FmBackupWidget::on_changeTargetDrive()
   354 void FmBackupWidget::on_changeTargetDrive()
   355 {
   355 {
   356     QString title = constFileManagerBackupSettingsTitleTargetDrive;  
   356     QString title = constFileManagerBackupSettingsTitleTargetDrive;  
   357     QStringList queryStringList;
   357     QString drive = FmDlgUtils::showBackupDriveQuery( title );
   358     QStringList driveStringList;
   358     if( !drive.isEmpty() && 
   359 
   359             mBackupSettings->targetDrive().compare( drive, Qt::CaseInsensitive ) != 0 ) {
   360     QStringList driveList;
   360         mBackupSettings->setTargetDrive( drive );
   361     //FmUtils::getDriveList( driveList, true );
       
   362     FmViewManager::viewManager()->operationService()->backupRestoreHandler()->getBackupDriveList( driveList );
       
   363     QString targetDrive =  mBackupSettings->targetDrive();
       
   364     int selectIndex = -1;
       
   365 
       
   366     int currentIndex = 0;
       
   367     for( QStringList::const_iterator it = driveList.begin(); it != driveList.end(); ++it )
       
   368     {
       
   369         QString drive = (*it);
       
   370         drive = FmUtils::removePathSplash( drive );
       
   371         QString driveWithVolume = FmUtils::fillDriveVolume( drive, true );
       
   372 
       
   373         driveStringList.push_back( drive );
       
   374         queryStringList.push_back( driveWithVolume );
       
   375 
       
   376         if( drive == targetDrive )
       
   377         {
       
   378             // adjust index offset against drive.
       
   379             selectIndex = currentIndex;
       
   380         }
       
   381         ++currentIndex;
       
   382     }
       
   383     
       
   384     if( FmDlgUtils::showSingleSettingQuery( title, queryStringList, selectIndex ) )
       
   385     {
       
   386         mBackupSettings->setTargetDrive( driveStringList.at( selectIndex ) );
       
   387         emit doModelRefresh();
   361         emit doModelRefresh();
   388     }
   362     }
   389 }
   363 }
   390 
   364 
   391 void FmBackupWidget::updateBackupDate()
   365 void FmBackupWidget::updateBackupDate()