author | hrw <hrw> | 2005-10-16 19:00:43 (UTC) |
---|---|---|
committer | hrw <hrw> | 2005-10-16 19:00:43 (UTC) |
commit | 965a373e7685c8ae2cfc9955efe20424aa95e10c (patch) (unidiff) | |
tree | 2ff27d09825648d8c7b1bb5795de5bf9beb6bb55 /noncore | |
parent | 611de84768e4825d6851dc833bd6402efd572383 (diff) | |
download | opie-965a373e7685c8ae2cfc9955efe20424aa95e10c.zip opie-965a373e7685c8ae2cfc9955efe20424aa95e10c.tar.gz opie-965a373e7685c8ae2cfc9955efe20424aa95e10c.tar.bz2 |
fixed bug #1492 - Backup and Restore does not show list of backups to restore on start
-rw-r--r-- | noncore/settings/backup/backuprestore.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp index eadfb63..711dab3 100644 --- a/noncore/settings/backup/backuprestore.cpp +++ b/noncore/settings/backup/backuprestore.cpp | |||
@@ -81,48 +81,49 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags f | |||
81 | : BackupAndRestoreBase(parent, name, fl) | 81 | : BackupAndRestoreBase(parent, name, fl) |
82 | { | 82 | { |
83 | backupList->header()->hide(); | 83 | backupList->header()->hide(); |
84 | restoreList->header()->hide(); | 84 | restoreList->header()->hide(); |
85 | locationList->header()->hide(); | 85 | locationList->header()->hide(); |
86 | connect( backupButton, SIGNAL( clicked() ), this, SLOT( backup() ) ); | 86 | connect( backupButton, SIGNAL( clicked() ), this, SLOT( backup() ) ); |
87 | connect( restoreButton, SIGNAL( clicked() ), this, SLOT( restore() ) ); | 87 | connect( restoreButton, SIGNAL( clicked() ), this, SLOT( restore() ) ); |
88 | connect( backupList, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( selectItem( QListViewItem* ) ) ); | 88 | connect( backupList, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( selectItem( QListViewItem* ) ) ); |
89 | connect( restoreSource, SIGNAL( activated( int ) ), this, SLOT( sourceDirChanged( int ) ) ); | 89 | connect( restoreSource, SIGNAL( activated( int ) ), this, SLOT( sourceDirChanged( int ) ) ); |
90 | connect( addLocationButton, SIGNAL( clicked() ), this, SLOT( addLocation() ) ); | 90 | connect( addLocationButton, SIGNAL( clicked() ), this, SLOT( addLocation() ) ); |
91 | connect( removeLocationButton, SIGNAL( clicked() ), this, SLOT( removeLocation() ) ); | 91 | connect( removeLocationButton, SIGNAL( clicked() ), this, SLOT( removeLocation() ) ); |
92 | connect( selectLocationButton, SIGNAL( clicked() ), this, SLOT( selectLocation() ) ); | 92 | connect( selectLocationButton, SIGNAL( clicked() ), this, SLOT( selectLocation() ) ); |
93 | 93 | ||
94 | //add directorys for backing up | 94 | //add directorys for backing up |
95 | applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/"); | 95 | applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/"); |
96 | selectItem(applicationSettings); | 96 | selectItem(applicationSettings); |
97 | applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/"); | 97 | applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/"); |
98 | selectItem(applicationSettings); | 98 | selectItem(applicationSettings); |
99 | documents= new QListViewItem(backupList, "Documents", "", "Documents/"); | 99 | documents= new QListViewItem(backupList, "Documents", "", "Documents/"); |
100 | selectItem(documents); | 100 | selectItem(documents); |
101 | 101 | ||
102 | scanForApplicationSettings(); | 102 | scanForApplicationSettings(); |
103 | refreshLocations(); | 103 | refreshLocations(); |
104 | refreshBackupLocations(); | 104 | refreshBackupLocations(); |
105 | sourceDirChanged(restoreSource->currentItem()); | ||
105 | 106 | ||
106 | // Read the list of items to ignore. | 107 | // Read the list of items to ignore. |
107 | QList<QString> dontBackupList; | 108 | QList<QString> dontBackupList; |
108 | dontBackupList.setAutoDelete(true); | 109 | dontBackupList.setAutoDelete(true); |
109 | Config config("BackupAndRestore"); | 110 | Config config("BackupAndRestore"); |
110 | config.setGroup("DontBackup"); | 111 | config.setGroup("DontBackup"); |
111 | int total = config.readNumEntry("Total", 0); | 112 | int total = config.readNumEntry("Total", 0); |
112 | for(int i = 0; i < total; i++) | 113 | for(int i = 0; i < total; i++) |
113 | { | 114 | { |
114 | dontBackupList.append(new QString(config.readEntry(QString("%1").arg(i), ""))); | 115 | dontBackupList.append(new QString(config.readEntry(QString("%1").arg(i), ""))); |
115 | } | 116 | } |
116 | 117 | ||
117 | QList<QListViewItem> list; | 118 | QList<QListViewItem> list; |
118 | getAllItems(backupList->firstChild(), list); | 119 | getAllItems(backupList->firstChild(), list); |
119 | 120 | ||
120 | for(uint i = 0; i < list.count(); i++) | 121 | for(uint i = 0; i < list.count(); i++) |
121 | { | 122 | { |
122 | QString text = list.at(i)->text(HEADER_NAME); | 123 | QString text = list.at(i)->text(HEADER_NAME); |
123 | for(uint i2 = 0; i2 < dontBackupList.count(); i2++) | 124 | for(uint i2 = 0; i2 < dontBackupList.count(); i2++) |
124 | { | 125 | { |
125 | if(*dontBackupList.at(i2) == text) | 126 | if(*dontBackupList.at(i2) == text) |
126 | { | 127 | { |
127 | selectItem(list.at(i)); | 128 | selectItem(list.at(i)); |
128 | break; | 129 | break; |