From ea627be80ec12080ac0017b128ce63f627709949 Mon Sep 17 00:00:00 2001 From: Ken Date: Tue, 10 Sep 2013 15:57:08 -0400 Subject: [PATCH] Fix an issue with "~" in the filepath for file reversions of life-preserver --- src-qt4/life-preserver/LPBackend.cpp | 4 +++- src-qt4/life-preserver/LPWatcher.cpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src-qt4/life-preserver/LPBackend.cpp b/src-qt4/life-preserver/LPBackend.cpp index 3bdc5d26e..7a10bc3ed 100644 --- a/src-qt4/life-preserver/LPBackend.cpp +++ b/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){ diff --git a/src-qt4/life-preserver/LPWatcher.cpp b/src-qt4/life-preserver/LPWatcher.cpp index ef64f03b0..eb5225658 100644 --- a/src-qt4/life-preserver/LPWatcher.cpp +++ b/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;