summaryrefslogtreecommitdiff
path: root/noncore/settings/backup/backuprestore.cpp
Unidiff
Diffstat (limited to 'noncore/settings/backup/backuprestore.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/backup/backuprestore.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp
index 58e5c71..2eccdfe 100644
--- a/noncore/settings/backup/backuprestore.cpp
+++ b/noncore/settings/backup/backuprestore.cpp
@@ -1,10 +1,11 @@
1
2#include "backuprestore.h" 1#include "backuprestore.h"
3#include "errordialog.h" 2#include "errordialog.h"
4 3
5/* OPIE */ 4/* OPIE */
5#include <opie2/odebug.h>
6#include <opie2/ostorageinfo.h> 6#include <opie2/ostorageinfo.h>
7#include <qpe/qpeapplication.h> 7#include <qpe/qpeapplication.h>
8using namespace Opie::Core;
8 9
9/* QT */ 10/* QT */
10#include <qapplication.h> 11#include <qapplication.h>
@@ -40,7 +41,6 @@
40 41
41const QString tempFileName = "/tmp/backup.err"; 42const QString tempFileName = "/tmp/backup.err";
42 43
43
44BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl) 44BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl)
45 : BackupAndRestoreBase(parent, name, fl) 45 : BackupAndRestoreBase(parent, name, fl)
46{ 46{
@@ -73,17 +73,17 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags f
73 if ( storage.hasCf() ) 73 if ( storage.hasCf() )
74 { 74 {
75 backupLocations.insert( "CF", storage.cfPath() ); 75 backupLocations.insert( "CF", storage.cfPath() );
76 qDebug( "Cf Path: " + storage.cfPath() ); 76 odebug << "Cf Path: " + storage.cfPath() << oendl;
77 } 77 }
78 if ( storage.hasSd() ) 78 if ( storage.hasSd() )
79 { 79 {
80 backupLocations.insert( "SD", storage.sdPath() ); 80 backupLocations.insert( "SD", storage.sdPath() );
81 qDebug( " Sd Path: " + storage.sdPath() ); 81 odebug << " Sd Path: " + storage.sdPath() << oendl;
82 } 82 }
83 if ( storage.hasMmc() ) 83 if ( storage.hasMmc() )
84 { 84 {
85 backupLocations.insert( "MMC", storage.mmcPath() ); 85 backupLocations.insert( "MMC", storage.mmcPath() );
86 qDebug( "Mmc Path: " + storage.mmcPath() ); 86 odebug << "Mmc Path: " + storage.mmcPath() << oendl;
87 } 87 }
88 88
89 Config config("BackupAndRestore"); 89 Config config("BackupAndRestore");
@@ -203,7 +203,7 @@ void BackupAndRestore::scanForApplicationSettings()
203 QFileInfo *fi; 203 QFileInfo *fi;
204 while ( (fi=it.current()) ) 204 while ( (fi=it.current()) )
205 { 205 {
206 //qDebug((d.path()+"/"+fi->fileName()).latin1()); 206 //odebug << (d.path()+"/"+fi->fileName()).latin1() << oendl;
207 if ( ( fi->fileName() != "." ) && ( fi->fileName() != ".." ) ) 207 if ( ( fi->fileName() != "." ) && ( fi->fileName() != ".." ) )
208 { 208 {
209 QListViewItem *newItem = new QListViewItem(applicationSettings, fi->fileName()); 209 QListViewItem *newItem = new QListViewItem(applicationSettings, fi->fileName());
@@ -249,7 +249,7 @@ void BackupAndRestore::backup()
249 // We execute tar and compressing its output with gzip.. 249 // We execute tar and compressing its output with gzip..
250 // The error output will be written into a temp-file which could be provided 250 // The error output will be written into a temp-file which could be provided
251 // for debugging.. 251 // for debugging..
252 qDebug( "Storing file: %s", outputFile.latin1() ); 252 odebug << "Storing file: " << outputFile.latin1() << "" << oendl;
253 outputFile += EXTENSION; 253 outputFile += EXTENSION;
254 254
255 QString commandLine = QString( "cd %1 && (tar -X %1 -cz %2 Applications/backup/exclude -f %3 ) 2> %4" ).arg( QDir::homeDirPath() ) 255 QString commandLine = QString( "cd %1 && (tar -X %1 -cz %2 Applications/backup/exclude -f %3 ) 2> %4" ).arg( QDir::homeDirPath() )
@@ -258,7 +258,7 @@ void BackupAndRestore::backup()
258 .arg( outputFile.latin1() ) 258 .arg( outputFile.latin1() )
259 .arg( tempFileName.latin1() ); 259 .arg( tempFileName.latin1() );
260 260
261 qDebug( commandLine ); 261 odebug << commandLine << oendl;
262 262
263 int r = system( commandLine ); 263 int r = system( commandLine );
264 264
@@ -272,7 +272,7 @@ void BackupAndRestore::backup()
272 { 272 {
273 273
274 case 1: 274 case 1:
275 qWarning("Details pressed !"); 275 owarn << "Details pressed !" << oendl;
276 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true ); 276 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true );
277 QFile errorFile( tempFileName ); 277 QFile errorFile( tempFileName );
278 if ( errorFile.open(IO_ReadOnly) ) 278 if ( errorFile.open(IO_ReadOnly) )
@@ -359,7 +359,7 @@ void BackupAndRestore::sourceDirChanged(int selection)
359 359
360void BackupAndRestore::fileListUpdate() 360void BackupAndRestore::fileListUpdate()
361{ 361{
362 qWarning("void BackupAndRestore::fileListUpdate()"); 362 owarn << "void BackupAndRestore::fileListUpdate()" << oendl;
363 restoreList->clear(); 363 restoreList->clear();
364 rescanFolder( backupLocations[restoreSource->currentText()] ); 364 rescanFolder( backupLocations[restoreSource->currentText()] );
365} 365}
@@ -371,7 +371,7 @@ void BackupAndRestore::fileListUpdate()
371 */ 371 */
372void BackupAndRestore::rescanFolder(QString directory) 372void BackupAndRestore::rescanFolder(QString directory)
373{ 373{
374 //qDebug(QString("rescanFolder: ") + directory.latin1()); 374 //odebug << QString("rescanFolder: ") + directory.latin1() << oendl;
375 QDir d(directory); 375 QDir d(directory);
376 if(!d.exists()) 376 if(!d.exists())
377 return; 377 return;
@@ -419,7 +419,7 @@ void BackupAndRestore::restore()
419 419
420 restoreFile += "/" + restoreItem->text(0); 420 restoreFile += "/" + restoreItem->text(0);
421 421
422 qDebug( restoreFile ); 422 odebug << restoreFile << oendl;
423 423
424 //check if backup file come from opie 1.0.x 424 //check if backup file come from opie 1.0.x
425 425
@@ -442,7 +442,7 @@ void BackupAndRestore::restore()
442 .arg( restoreFile.latin1() ) 442 .arg( restoreFile.latin1() )
443 .arg( tempFileName.latin1() ); 443 .arg( tempFileName.latin1() );
444 444
445 qDebug( commandLine ); 445 odebug << commandLine << oendl;
446 446
447 r = system( commandLine ); 447 r = system( commandLine );
448 448
@@ -454,7 +454,7 @@ void BackupAndRestore::restore()
454 + errorMsg, QString( tr( "Ok") ), QString( tr( "Details" ) ) ) ) 454 + errorMsg, QString( tr( "Ok") ), QString( tr( "Details" ) ) ) )
455 { 455 {
456 case 1: 456 case 1:
457 qWarning("Details pressed !"); 457 owarn << "Details pressed !" << oendl;
458 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true ); 458 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true );
459 QFile errorFile( tempFileName ); 459 QFile errorFile( tempFileName );
460 if ( errorFile.open(IO_ReadOnly) ) 460 if ( errorFile.open(IO_ReadOnly) )