author | mickeyl <mickeyl> | 2003-12-20 00:53:04 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-12-20 00:53:04 (UTC) |
commit | f495453bc1c2157f3c0a9a7957d15d3b5f434a72 (patch) (unidiff) | |
tree | b3b3618608b1cb04642b8643cc905bc89d79cec6 | |
parent | 11c6b3b8ba56b28b160965387b4ffeffe2a2f143 (diff) | |
download | opie-f495453bc1c2157f3c0a9a7957d15d3b5f434a72.zip opie-f495453bc1c2157f3c0a9a7957d15d3b5f434a72.tar.gz opie-f495453bc1c2157f3c0a9a7957d15d3b5f434a72.tar.bz2 |
fix bug in line 73 - it helps to actually call the functions ;)
-rw-r--r-- | noncore/settings/backup/backuprestore.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp index 7d0daf7..cfba907 100644 --- a/noncore/settings/backup/backuprestore.cpp +++ b/noncore/settings/backup/backuprestore.cpp | |||
@@ -25,97 +25,97 @@ | |||
25 | 25 | ||
26 | #include <errno.h> | 26 | #include <errno.h> |
27 | #include <stdlib.h> | 27 | #include <stdlib.h> |
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | #include <sys/stat.h> | 29 | #include <sys/stat.h> |
30 | #include <dirent.h> | 30 | #include <dirent.h> |
31 | 31 | ||
32 | #define HEADER_NAME 0 | 32 | #define HEADER_NAME 0 |
33 | #define HEADER_BACKUP 1 | 33 | #define HEADER_BACKUP 1 |
34 | #define BACKUP_LOCATION 2 | 34 | #define BACKUP_LOCATION 2 |
35 | 35 | ||
36 | #define EXTENSION ".bck" | 36 | #define EXTENSION ".bck" |
37 | 37 | ||
38 | const QString tempFileName = "/tmp/backup.err"; | 38 | const QString tempFileName = "/tmp/backup.err"; |
39 | 39 | ||
40 | 40 | ||
41 | BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl) | 41 | BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl) |
42 | : BackupAndRestoreBase(parent, name, fl) | 42 | : BackupAndRestoreBase(parent, name, fl) |
43 | { | 43 | { |
44 | this->showMaximized(); | 44 | this->showMaximized(); |
45 | backupList->header()->hide(); | 45 | backupList->header()->hide(); |
46 | restoreList->header()->hide(); | 46 | restoreList->header()->hide(); |
47 | connect(backupButton, SIGNAL(clicked()), | 47 | connect(backupButton, SIGNAL(clicked()), |
48 | this, SLOT(backup())); | 48 | this, SLOT(backup())); |
49 | connect(restoreButton, SIGNAL(clicked()), | 49 | connect(restoreButton, SIGNAL(clicked()), |
50 | this, SLOT(restore())); | 50 | this, SLOT(restore())); |
51 | connect(backupList, SIGNAL(clicked( QListViewItem * )), | 51 | connect(backupList, SIGNAL(clicked( QListViewItem * )), |
52 | this, SLOT(selectItem(QListViewItem*))); | 52 | this, SLOT(selectItem(QListViewItem*))); |
53 | connect(restoreSource, SIGNAL(activated( int )), | 53 | connect(restoreSource, SIGNAL(activated( int )), |
54 | this, SLOT(sourceDirChanged(int))); | 54 | this, SLOT(sourceDirChanged(int))); |
55 | connect(updateList, SIGNAL(clicked()), | 55 | connect(updateList, SIGNAL(clicked()), |
56 | this, SLOT( fileListUpdate())); | 56 | this, SLOT( fileListUpdate())); |
57 | 57 | ||
58 | //add directorys for backing up | 58 | //add directorys for backing up |
59 | applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/"); | 59 | applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/"); |
60 | selectItem(applicationSettings); | 60 | selectItem(applicationSettings); |
61 | applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/"); | 61 | applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/"); |
62 | selectItem(applicationSettings); | 62 | selectItem(applicationSettings); |
63 | documents= new QListViewItem(backupList, "Documents", "", "Documents/"); | 63 | documents= new QListViewItem(backupList, "Documents", "", "Documents/"); |
64 | selectItem(documents); | 64 | selectItem(documents); |
65 | 65 | ||
66 | scanForApplicationSettings(); | 66 | scanForApplicationSettings(); |
67 | 67 | ||
68 | backupLocations.insert( "Documents", QDir::homeDirPath() + "/Documents" ); | 68 | backupLocations.insert( "Documents", QDir::homeDirPath() + "/Documents" ); |
69 | if (StorageInfo::hasCf()) | 69 | if (StorageInfo::hasCf()) |
70 | { | 70 | { |
71 | backupLocations.insert("CF", "/mnt/cf"); | 71 | backupLocations.insert("CF", "/mnt/cf"); |
72 | } | 72 | } |
73 | if (StorageInfo::hasSd || StorageInfo::hasMmc) | 73 | if (StorageInfo::hasSd() || StorageInfo::hasMmc()) |
74 | { | 74 | { |
75 | backupLocations.insert("SD", "/mnt/card"); | 75 | backupLocations.insert("SD", "/mnt/card"); |
76 | } | 76 | } |
77 | 77 | ||
78 | QMap<QString, QString>::Iterator it; | 78 | QMap<QString, QString>::Iterator it; |
79 | for( it = backupLocations.begin(); it != backupLocations.end(); ++it ) | 79 | for( it = backupLocations.begin(); it != backupLocations.end(); ++it ) |
80 | { | 80 | { |
81 | storeToLocation->insertItem(it.key()); | 81 | storeToLocation->insertItem(it.key()); |
82 | restoreSource->insertItem(it.key()); | 82 | restoreSource->insertItem(it.key()); |
83 | } | 83 | } |
84 | 84 | ||
85 | // Read the list of items to ignore. | 85 | // Read the list of items to ignore. |
86 | Config config("BackupAndRestore"); | 86 | Config config("BackupAndRestore"); |
87 | 87 | ||
88 | QList<QString> dontBackupList; | 88 | QList<QString> dontBackupList; |
89 | dontBackupList.setAutoDelete(true); | 89 | dontBackupList.setAutoDelete(true); |
90 | config.setGroup("DontBackup"); | 90 | config.setGroup("DontBackup"); |
91 | int total = config.readNumEntry("Total", 0); | 91 | int total = config.readNumEntry("Total", 0); |
92 | for(int i = 0; i < total; i++) | 92 | for(int i = 0; i < total; i++) |
93 | { | 93 | { |
94 | dontBackupList.append(new QString(config.readEntry(QString("%1").arg(i), ""))); | 94 | dontBackupList.append(new QString(config.readEntry(QString("%1").arg(i), ""))); |
95 | } | 95 | } |
96 | 96 | ||
97 | QList<QListViewItem> list; | 97 | QList<QListViewItem> list; |
98 | getAllItems(backupList->firstChild(), list); | 98 | getAllItems(backupList->firstChild(), list); |
99 | 99 | ||
100 | for(uint i = 0; i < list.count(); i++) | 100 | for(uint i = 0; i < list.count(); i++) |
101 | { | 101 | { |
102 | QString text = list.at(i)->text(HEADER_NAME); | 102 | QString text = list.at(i)->text(HEADER_NAME); |
103 | for(uint i2 = 0; i2 < dontBackupList.count(); i2++) | 103 | for(uint i2 = 0; i2 < dontBackupList.count(); i2++) |
104 | { | 104 | { |
105 | if(*dontBackupList.at(i2) == text) | 105 | if(*dontBackupList.at(i2) == text) |
106 | { | 106 | { |
107 | selectItem(list.at(i)); | 107 | selectItem(list.at(i)); |
108 | break; | 108 | break; |
109 | } | 109 | } |
110 | } | 110 | } |
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
114 | BackupAndRestore::~BackupAndRestore() | 114 | BackupAndRestore::~BackupAndRestore() |
115 | { | 115 | { |
116 | QList<QListViewItem> list; | 116 | QList<QListViewItem> list; |
117 | getAllItems(backupList->firstChild(), list); | 117 | getAllItems(backupList->firstChild(), list); |
118 | 118 | ||
119 | Config config("BackupAndRestore"); | 119 | Config config("BackupAndRestore"); |
120 | config.setGroup("DontBackup"); | 120 | config.setGroup("DontBackup"); |
121 | config.clearGroup(); | 121 | config.clearGroup(); |