summaryrefslogtreecommitdiff
path: root/noncore
authorar <ar>2005-02-18 20:21:32 (UTC)
committer ar <ar>2005-02-18 20:21:32 (UTC)
commitd8254f2f295b07bdadf6b4b25f0bd125d8121c28 (patch) (side-by-side diff)
treebc3edde3980b5c568e630ef4418e7508e3d5d374 /noncore
parent03da1c30d7d6c7197a551219e3a36c9a3f469cc8 (diff)
downloadopie-d8254f2f295b07bdadf6b4b25f0bd125d8121c28.zip
opie-d8254f2f295b07bdadf6b4b25f0bd125d8121c28.tar.gz
opie-d8254f2f295b07bdadf6b4b25f0bd125d8121c28.tar.bz2
- #1570 - Confirmation needed before restore backup and overwrite local data
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/backup/backuprestore.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp
index 8928cda..180980a 100644
--- a/noncore/settings/backup/backuprestore.cpp
+++ b/noncore/settings/backup/backuprestore.cpp
@@ -566,48 +566,53 @@ void BackupAndRestore::rescanFolder(QString directory)
else
{
// If it is a backup file add to list.
if(file->fileName().contains(EXTENSION))
(void)new QListViewItem(restoreList, file->fileName());
}
++it;
}
}
/**
* Restore a backup file.
* Report errors or success
*/
void BackupAndRestore::restore()
{
QListViewItem *restoreItem = restoreList->currentItem();
if(!restoreItem)
{
QMessageBox::critical(this, tr( "Message" ),
tr( "Please select something to restore." ),QString( tr( "Ok") ) );
return;
}
+ if ( QMessageBox::warning( this, tr( "Restore" ),
+ tr( "Would you really overwrite your local data?" ),
+ tr( "Yes" ), tr( "No" ), "", 1 ) == 1 )
+ return;
+
OWait *owait = new OWait();
Global::statusMessage( tr( "Restore Backup..." ) );
owait->show();
qApp->processEvents();
QString restoreFile = backupLocations[restoreSource->currentText()];
restoreFile += "/" + restoreItem->text(0);
odebug << restoreFile << oendl;
//check if backup file come from opie 1.0.x
QString commandLine = QString( "tar -tzf %1 | grep Applications/backup/exclude" ).arg( restoreFile.latin1() );
int r = system( commandLine );
QString startDir;
if( r != 0 ) //Applications/backup/exclude not found - old backup file
{
startDir = QString( "/" );
} else
{