Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Fix an issue with "~" in the filepath for file reversions of life-pre…
Browse files Browse the repository at this point in the history
…server
  • Loading branch information
Ken committed Sep 10, 2013
1 parent fcd9065 commit ea627be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src-qt4/life-preserver/LPBackend.cpp
Expand Up @@ -187,7 +187,8 @@ bool LPBackend::revertSnapshot(QString dataset, QString snapshot){
QString LPBackend::revertSnapshotFile(QString dsmountpoint, QString snapshot, QString filepath){
//Copy the given file from the snapshot back into the main dataset
// -- filepath: full path to the file in the snapshot directory

//qDebug() << " - Revert file:" << filepath;
filepath.replace("~",QDir::homePath());
//Check that the file path is complete and the file exists
if(!QFile::exists(filepath)){
//invalid file given
Expand Down Expand Up @@ -222,6 +223,7 @@ QString LPBackend::revertSnapshotFile(QString dsmountpoint, QString snapshot, QS
}
}
//perform the copy
qDebug() << " - File Reversion:" << filepath << newfilepath;
bool ok = QFile::copy(filepath,newfilepath);
//return the path to the new file if the copy was successful
if(ok){
Expand Down
1 change: 1 addition & 0 deletions src-qt4/life-preserver/LPWatcher.cpp
Expand Up @@ -251,6 +251,7 @@ void LPWatcher::fileChanged(QString file){
}

void LPWatcher::checkErrorFile(){
//Check zpool status and report any errors/processes
if(QFile::exists(FILE_ERROR)){
//Read the file to determine the cause of the error
QString msg, id, summary, timestamp, time, dataset;
Expand Down

0 comments on commit ea627be

Please sign in to comment.