Diffstat (limited to 'noncore/settings/backup/backuprestore.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/backup/backuprestore.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp index 922523b..1c854d9 100644 --- a/noncore/settings/backup/backuprestore.cpp +++ b/noncore/settings/backup/backuprestore.cpp @@ -39,4 +39,4 @@ const QString tempFileName = "/tmp/backup.err"; -BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name) - : BackupAndRestoreBase(parent, name){ +BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl) + : BackupAndRestoreBase(parent, name, fl){ this->showMaximized(); @@ -49,7 +49,7 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name) connect(backupList, SIGNAL(clicked( QListViewItem * )), - this, SLOT(selectItem(QListViewItem*))); + this, SLOT(selectItem(QListViewItem*))); connect(restoreSource, SIGNAL(activated( int )), - this, SLOT(sourceDirChanged(int))); + this, SLOT(sourceDirChanged(int))); connect(updateList, SIGNAL(clicked()), - this, SLOT( fileListUpdate())); + this, SLOT( fileListUpdate())); @@ -64,5 +64,5 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name) selectItem(documents); - + scanForApplicationSettings(); - + Config config("BackupAndRestore"); @@ -70,3 +70,3 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name) int totalLocations = config.readNumEntry("totalLocations",0); - + //todo make less static here and use Storage class to get infos @@ -88,4 +88,4 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name) } - - // Read the list of items to ignore. + + // Read the list of items to ignore. QList<QString> dontBackupList; @@ -100,3 +100,3 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name) getAllItems(backupList->firstChild(), list); - + for(uint i = 0; i < list.count(); i++){ @@ -115,3 +115,3 @@ BackupAndRestore::~BackupAndRestore(){ getAllItems(backupList->firstChild(), list); - + Config config("BackupAndRestore"); @@ -119,3 +119,3 @@ BackupAndRestore::~BackupAndRestore(){ config.clearGroup(); - + int count = 0; @@ -137,3 +137,3 @@ QList<QListViewItem> BackupAndRestore::getAllItems(QListViewItem *item, QList<QL if(item->childCount() > 0) - getAllItems(item->firstChild(), list); + getAllItems(item->firstChild(), list); list.append(item); @@ -181,6 +181,6 @@ void BackupAndRestore::scanForApplicationSettings(){ * The "Backup" button has been pressed. Get a list of all of the files that - * should be backed up. If there are no files, emit and error and exit. + * should be backed up. If there are no files, emit and error and exit. * Determine the file name to store the backup in. Backup the file(s) using * tar and gzip --best. Report failure or success - */ + */ void BackupAndRestore::backupPressed(){ @@ -190,3 +190,3 @@ void BackupAndRestore::backupPressed(){ "No items selected.",QString("Ok") ); - return; + return; } @@ -197,3 +197,3 @@ void BackupAndRestore::backupPressed(){ QDateTime datetime = QDateTime::currentDateTime(); - QString dateString = QString::number( datetime.date().year() ) + QString::number( datetime.date().month() ).rightJustify(2, '0') + + QString dateString = QString::number( datetime.date().year() ) + QString::number( datetime.date().month() ).rightJustify(2, '0') + QString::number( datetime.date().day() ).rightJustify(2, '0'); @@ -201,3 +201,3 @@ void BackupAndRestore::backupPressed(){ outputFile += "/" + dateString; - + QString t = outputFile; @@ -209,3 +209,3 @@ void BackupAndRestore::backupPressed(){ - // We execute tar and compressing its output with gzip.. + // We execute tar and compressing its output with gzip.. // The error output will be written into a temp-file which could be provided @@ -230,3 +230,3 @@ void BackupAndRestore::backupPressed(){ - switch( QMessageBox::critical(this, tr( "Message" ), tr( "Backup Failed!" ) + "\n" + switch( QMessageBox::critical(this, tr( "Message" ), tr( "Backup Failed!" ) + "\n" + errorMsg, QString( tr( "Ok" ) ), QString( tr( "Details" ) ) ) ){ @@ -244,3 +244,3 @@ void BackupAndRestore::backupPressed(){ errorFile.close(); - + pErrDialog->m_textarea->setText( s ); @@ -255,3 +255,3 @@ void BackupAndRestore::backupPressed(){ setCaption(tr("Backup and Restore.. Failed !!")); - return; + return; } @@ -259,3 +259,3 @@ void BackupAndRestore::backupPressed(){ QMessageBox::information(this, tr( "Message" ), tr( "Backup Successfull." ), QString(tr( "Ok" ) ) ); - + } @@ -266,3 +266,3 @@ void BackupAndRestore::backupPressed(){ * Get a list of all of the files to backup. - */ + */ int BackupAndRestore::getBackupFiles(QString &backupFiles, QListViewItem *parent){ @@ -276,3 +276,3 @@ int BackupAndRestore::getBackupFiles(QString &backupFiles, QListViewItem *parent } - + uint count = 0; @@ -319,3 +319,3 @@ void BackupAndRestore::rescanFolder(QString directory){ return; - + d.setFilter( QDir::Files | QDir::Hidden | QDir::Dirs); @@ -343,3 +343,3 @@ void BackupAndRestore::rescanFolder(QString directory){ * Report errors or success - */ + */ void BackupAndRestore::restore(){ @@ -349,3 +349,3 @@ void BackupAndRestore::restore(){ tr( "Please select something to restore." ),QString( tr( "Ok") ) ); - return; + return; } @@ -354,5 +354,5 @@ void BackupAndRestore::restore(){ QString restoreFile = backupLocations[restoreSource->currentText()]; - + restoreFile += "/" + restoreItem->text(0); - + int r = system(QString("tar -C / -zxf %1 2> %3") @@ -362,3 +362,3 @@ void BackupAndRestore::restore(){ QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno ); - switch( QMessageBox::critical(this, tr( "Message" ), tr( "Restore Failed." ) + "\n" + switch( QMessageBox::critical(this, tr( "Message" ), tr( "Restore Failed." ) + "\n" + errorMsg, QString( tr( "Ok") ), QString( tr( "Details" ) ) ) ) { @@ -375,3 +375,3 @@ void BackupAndRestore::restore(){ errorFile.close(); - + pErrDialog->m_textarea->setText( s ); @@ -385,3 +385,3 @@ void BackupAndRestore::restore(){ setCaption(tr("Backup and Restore.. Failed !!")); - return; + return; |