Diffstat (limited to 'noncore/settings/backup/backuprestore.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/backup/backuprestore.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp index 02998f0..618ce24 100644 --- a/noncore/settings/backup/backuprestore.cpp +++ b/noncore/settings/backup/backuprestore.cpp | |||
@@ -1,2 +1,8 @@ | |||
1 | |||
1 | #include "backuprestore.h" | 2 | #include "backuprestore.h" |
3 | #include "output.h" | ||
4 | |||
5 | #include <qapplication.h> | ||
6 | #include <qmultilineedit.h> | ||
7 | |||
2 | #include <qdir.h> | 8 | #include <qdir.h> |
@@ -15,2 +21,8 @@ | |||
15 | 21 | ||
22 | #include <errno.h> | ||
23 | #include <stdlib.h> | ||
24 | #include <unistd.h> | ||
25 | #include <sys/stat.h> | ||
26 | #include <dirent.h> | ||
27 | |||
16 | #define HEADER_NAME 0 | 28 | #define HEADER_NAME 0 |
@@ -167,2 +179,3 @@ void BackupAndRestore::backupPressed(){ | |||
167 | 179 | ||
180 | setCaption(tr("Backup and Restore... working...")); | ||
168 | QString outputFile = backupLocations[storeToLocation->currentText()]; | 181 | QString outputFile = backupLocations[storeToLocation->currentText()]; |
@@ -179,7 +192,15 @@ void BackupAndRestore::backupPressed(){ | |||
179 | } | 192 | } |
193 | |||
194 | qDebug(QString("system(\"tar -c %1 | gzip > %2\")").arg(backupFiles).arg(outputFile).latin1()); | ||
180 | outputFile += EXTENSION; | 195 | outputFile += EXTENSION; |
181 | qDebug("system(\"tar -c %1 | gzip > %2\").arg(backupFiles).arg(outputFile).latin1())"); | 196 | |
182 | int r = system(QString("tar -c %1 | gzip > %2").arg(backupFiles).arg(outputFile).latin1() ); | 197 | int r = system(QString("tar -c %1 | gzip > %2").arg(backupFiles).arg(outputFile).latin1() ); |
198 | |||
199 | |||
200 | |||
183 | if(r != 0){ | 201 | if(r != 0){ |
184 | QMessageBox::critical(this, "Message", "Backup Failed.",QString("Ok") ); | 202 | perror("Error: "); |
203 | QString errorMsg="Error\n"+(QString)strerror(errno); | ||
204 | |||
205 | QMessageBox::critical(this, "Message", "Backup Failed.\n"+errorMsg, QString("Ok") ); | ||
185 | return; | 206 | return; |
@@ -188,3 +209,5 @@ void BackupAndRestore::backupPressed(){ | |||
188 | QMessageBox::critical(this, "Message", "Backup Successfull.",QString("Ok") ); | 209 | QMessageBox::critical(this, "Message", "Backup Successfull.",QString("Ok") ); |
210 | |||
189 | } | 211 | } |
212 | setCaption(tr("Backup and Restore")); | ||
190 | } | 213 | } |