summaryrefslogtreecommitdiff
path: root/noncore/settings/backup/backuprestore.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/backup/backuprestore.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/backup/backuprestore.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp
index 477e24d..93bedf6 100644
--- a/noncore/settings/backup/backuprestore.cpp
+++ b/noncore/settings/backup/backuprestore.cpp
@@ -243,97 +243,97 @@ void BackupAndRestore::backup()
QString commandLine = QString( "(tar -C %1 -c %2 | gzip > %3 ) 2> %4" ).arg( QDir::homeDirPath() )
.arg( backupFiles )
.arg( outputFile.latin1() )
.arg( tempFileName.latin1() );
qDebug( commandLine );
int r = system( commandLine );
if(r != 0)
{
perror("Error: ");
QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno );
switch( QMessageBox::critical(this, tr( "Message" ), tr( "Backup Failed!" ) + "\n"
+ errorMsg, QString( tr( "Ok" ) ), QString( tr( "Details" ) ) ) )
{
case 1:
qWarning("Details pressed !");
ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true );
QFile errorFile( tempFileName );
if ( errorFile.open(IO_ReadOnly) )
{
QTextStream t( &errorFile );
QString s;
while ( !t.eof() )
{ // until end of file...
s += t.readLine(); // line of text excluding '\n'
}
errorFile.close();
pErrDialog->m_textarea->setText( s );
}
else
{
pErrDialog->m_textarea->setText( "Unable to open File: /tmp/backup.er" );
}
pErrDialog->showMaximized();
pErrDialog->exec();
delete pErrDialog;
break;
}
setCaption(tr("Backup and Restore.. Failed !!"));
return;
}
else
{
- QMessageBox::information(this, tr( "Message" ), tr( "Backup Successfull." ), QString(tr( "Ok" ) ) );
+ QMessageBox::information(this, tr( "Message" ), tr( "Backup Successful." ), QString(tr( "Ok" ) ) );
}
//write store-location
Config config( "BackupAndRestore" );
config.setGroup( "LastLocation" );
config.writeEntry( "LastStoreLocation", storeToLocation->currentText() );
setCaption(tr("Backup and Restore"));
}
/***
* Get a list of all of the files to backup.
*/
int BackupAndRestore::getBackupFiles(QString &backupFiles, QListViewItem *parent)
{
QListViewItem * currentItem;
QString currentHome;
if(!parent)
currentItem = backupList->firstChild();
else
{
currentItem = parent->firstChild();
currentHome = parent->text(BACKUP_LOCATION);
}
uint count = 0;
while( currentItem != 0 )
{
if(currentItem->text(HEADER_BACKUP) == "B" )
{
if(currentItem->childCount() == 0 )
{
if(parent == NULL)
backupFiles += currentItem->text(BACKUP_LOCATION);
else
backupFiles += currentHome + currentItem->text(HEADER_NAME);
backupFiles += " ";
count++;
}
else
{
count += getBackupFiles(backupFiles, currentItem);
}
}
currentItem = currentItem->nextSibling();
}
return count;
@@ -411,61 +411,61 @@ void BackupAndRestore::restore()
QString commandLine = QString( "tar -C %1 -zxf %2 2> %3" ).arg( QDir::homeDirPath() )
.arg( restoreFile.latin1() )
.arg( tempFileName.latin1() );
qDebug( commandLine );
int r = system( commandLine );
if(r != 0)
{
QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno );
switch( QMessageBox::critical(this, tr( "Message" ), tr( "Restore Failed." ) + "\n"
+ errorMsg, QString( tr( "Ok") ), QString( tr( "Details" ) ) ) )
{
case 1:
qWarning("Details pressed !");
ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true );
QFile errorFile( tempFileName );
if ( errorFile.open(IO_ReadOnly) )
{
QTextStream t( &errorFile );
QString s;
while ( !t.eof() )
{ // until end of file...
s += t.readLine(); // line of text excluding '\n'
}
errorFile.close();
pErrDialog->m_textarea->setText( s );
}
else
{
pErrDialog->m_textarea->setText( tr( "Unable to open File: %1" ).arg( "/tmp/backup.er" ) );
}
pErrDialog->showMaximized();
pErrDialog->exec();
delete pErrDialog;
setCaption(tr("Backup and Restore.. Failed !!"));
return;
break;
}
}
else
{
- QMessageBox::information(this, tr( "Message" ), tr( "Restore Successfull." ), QString( tr( "Ok") ) );
+ QMessageBox::information(this, tr( "Message" ), tr( "Restore Successful." ), QString( tr( "Ok") ) );
}
//write restore-location
Config config( "BackupAndRestore" );
config.setGroup( "LastLocation" );
config.writeEntry( "LastRestoreLocation", restoreSource->currentText() );
setCaption(tr("Backup and Restore"));
}
// backuprestore.cpp