Ignore:
Timestamp:
03/05/14 09:17:14 (8 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
0debaa77
Parents:
109c737
Message:

Fix a bug in the Life-preserver GUI where if the parent/containing directory for a reversion is missing it would fail. Now it will automatically re-create the parent directory heirarchy as necessary when doing a restore.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/life-preserver/lp-gui/LPMain.cpp

    r109c737 r65e10ad  
    344344  QString filePath = fsModel->filePath( ui->treeView->currentIndex() ); 
    345345  qDebug() << " Restore file(s):" << filePath; 
    346   QString destDir = filePath.remove("/.zfs/snapshot/"+ui->label_snapshot->text()); 
     346  QFileInfo info(filePath);      
     347  QString destDir = filePath; 
     348        destDir.remove("/.zfs/snapshot/"+ui->label_snapshot->text()); 
    347349        destDir.chop( filePath.section("/",-1).size()+1 ); //get rid of the filename at the end 
    348350        while(!QFile::exists(destDir)){ destDir.chop( destDir.section("/",-1).size() +1); } 
     
    351353  //Perform the reversion(s) 
    352354  QStringList errors; 
    353   if(QFileInfo(filePath).isDir()){ 
     355  if( info.isDir() ){ 
    354356    //Is a directory 
    355357    showWaitBox( QString(tr("Restoring Directory: %1")).arg(newFilePath) ); 
Note: See TracChangeset for help on using the changeset viewer.