summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/backup/backuprestore.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp
index 533d3a5..1ebe912 100644
--- a/noncore/settings/backup/backuprestore.cpp
+++ b/noncore/settings/backup/backuprestore.cpp
@@ -30,48 +30,51 @@
30#define BACKUP_LOCATION 2 30#define BACKUP_LOCATION 2
31 31
32#define EXTENSION ".bck" 32#define EXTENSION ".bck"
33 33
34BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name) 34BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name)
35 : BackupAndRestoreBase(parent, name){ 35 : BackupAndRestoreBase(parent, name){
36 this->showMaximized(); 36 this->showMaximized();
37 backupList->header()->hide(); 37 backupList->header()->hide();
38 restoreList->header()->hide(); 38 restoreList->header()->hide();
39 connect(backupButton, SIGNAL(clicked()), 39 connect(backupButton, SIGNAL(clicked()),
40 this, SLOT(backupPressed())); 40 this, SLOT(backupPressed()));
41 connect(restoreButton, SIGNAL(clicked()), 41 connect(restoreButton, SIGNAL(clicked()),
42 this, SLOT(restore())); 42 this, SLOT(restore()));
43 connect(backupList, SIGNAL(clicked( QListViewItem * )), 43 connect(backupList, SIGNAL(clicked( QListViewItem * )),
44 this, SLOT(selectItem(QListViewItem*))); 44 this, SLOT(selectItem(QListViewItem*)));
45 connect(restoreSource, SIGNAL(activated( int )), 45 connect(restoreSource, SIGNAL(activated( int )),
46 this, SLOT(sourceDirChanged(int))); 46 this, SLOT(sourceDirChanged(int)));
47 47
48 systemSettings = new QListViewItem(backupList, "System Settings", "", 48 systemSettings = new QListViewItem(backupList, "System Settings", "",
49 "/etc"); 49 "/etc");
50 selectItem(systemSettings); 50 selectItem(systemSettings);
51 applicationSettings = new QListViewItem(backupList, "Application Settings", "", 51 applicationSettings = new QListViewItem(backupList, "Application Settings", "",
52 QDir::homeDirPath() + "/Settings/"); 52 QDir::homeDirPath() + "/Settings/");
53 selectItem(applicationSettings); 53 selectItem(applicationSettings);
54 applicationSettings = new QListViewItem(backupList, "Application Data", "",
55 QDir::homeDirPath() + "/Applications/");
56 selectItem(applicationSettings);
54 documents= new QListViewItem(backupList, "Documents", "", 57 documents= new QListViewItem(backupList, "Documents", "",
55 QDir::homeDirPath() + "/Documents/"); 58 QDir::homeDirPath() + "/Documents/");
56 selectItem(documents); 59 selectItem(documents);
57 60
58 scanForApplicationSettings(); 61 scanForApplicationSettings();
59 62
60 Config config("BackupAndRestore"); 63 Config config("BackupAndRestore");
61 config.setGroup("General"); 64 config.setGroup("General");
62 int totalLocations = config.readNumEntry("totalLocations",0); 65 int totalLocations = config.readNumEntry("totalLocations",0);
63 66
64//todo make less static here and use Storage class to get infos 67//todo make less static here and use Storage class to get infos
65 if(totalLocations == 0){ 68 if(totalLocations == 0){
66 backupLocations.insert("Documents", "/root/Documents"); 69 backupLocations.insert("Documents", "/root/Documents");
67 backupLocations.insert("CF", "/mnt/cf"); 70 backupLocations.insert("CF", "/mnt/cf");
68 backupLocations.insert("SD", "/mnt/card"); 71 backupLocations.insert("SD", "/mnt/card");
69 } 72 }
70 else{ 73 else{
71 for(int i = 0; i < totalLocations; i++){ 74 for(int i = 0; i < totalLocations; i++){
72 backupLocations.insert(config.readEntry(QString("backupLocationName_%1").arg(i)), 75 backupLocations.insert(config.readEntry(QString("backupLocationName_%1").arg(i)),
73 config.readEntry(QString("backupLocation_%1").arg(i))); 76 config.readEntry(QString("backupLocation_%1").arg(i)));
74 } 77 }
75 } 78 }
76 QMap<QString, QString>::Iterator it; 79 QMap<QString, QString>::Iterator it;
77 for( it = backupLocations.begin(); it != backupLocations.end(); ++it ){ 80 for( it = backupLocations.begin(); it != backupLocations.end(); ++it ){