Skip to content
Browse files

Fix an issue with "~" in the filepath for file reversions of life-pre…

…server
  • Loading branch information...
1 parent fcd9065 commit ea627be80ec12080ac0017b128ce63f627709949 @beanpole135 beanpole135 committed Sep 10, 2013
Showing with 4 additions and 1 deletion.
  1. +3 −1 src-qt4/life-preserver/LPBackend.cpp
  2. +1 −0 src-qt4/life-preserver/LPWatcher.cpp
View
4 src-qt4/life-preserver/LPBackend.cpp
@@ -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
@@ -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){
View
1 src-qt4/life-preserver/LPWatcher.cpp
@@ -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;

0 comments on commit ea627be

Please sign in to comment.
Something went wrong with that request. Please try again.