-rw-r--r-- | microkde/kapplication.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index 2c9e3b6..f36c5ae 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp | |||
@@ -154,49 +154,52 @@ class KBackupPrefs : public QDialog | |||
154 | tcal = new QRadioButton(i18n("Try again later"), format ); | 154 | tcal = new QRadioButton(i18n("Try again later"), format ); |
155 | ical = new QRadioButton(i18n("Try again tomorrow"), format ); | 155 | ical = new QRadioButton(i18n("Try again tomorrow"), format ); |
156 | ocal = new QRadioButton(i18n("Disable backup"), format ); | 156 | ocal = new QRadioButton(i18n("Disable backup"), format ); |
157 | vcal->setChecked( true ); | 157 | vcal->setChecked( true ); |
158 | QPushButton * ok = new QPushButton( i18n("OK"), this ); | 158 | QPushButton * ok = new QPushButton( i18n("OK"), this ); |
159 | lay->addWidget(ok ); | 159 | lay->addWidget(ok ); |
160 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 160 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
161 | } | 161 | } |
162 | 162 | ||
163 | bool again() { return vcal->isChecked(); } | 163 | bool again() { return vcal->isChecked(); } |
164 | bool later() { return tcal->isChecked(); } | 164 | bool later() { return tcal->isChecked(); } |
165 | bool againTomorrow() { return ical->isChecked(); } | 165 | bool againTomorrow() { return ical->isChecked(); } |
166 | private: | 166 | private: |
167 | QRadioButton* vcal, *ical, *ocal, *tcal; | 167 | QRadioButton* vcal, *ical, *ocal, *tcal; |
168 | }; | 168 | }; |
169 | int KApplication::createBackup( QString fn, QString dp, int numBup ) | 169 | int KApplication::createBackup( QString fn, QString dp, int numBup ) |
170 | { | 170 | { |
171 | if ( numBup < 1) return 3; | 171 | if ( numBup < 1) return 3; |
172 | int ret = 3; | 172 | int ret = 3; |
173 | //qDebug("KApplication::createBackup %s --- %s --- %d", fn.latin1(), dp.latin1(), numBup); | 173 | //qDebug("KApplication::createBackup %s --- %s --- %d", fn.latin1(), dp.latin1(), numBup); |
174 | QDir bupDir ( dp ); | 174 | QDir bupDir ( dp ); |
175 | bool tryAgain = true; | 175 | bool tryAgain = true; |
176 | while ( tryAgain ) { | 176 | while ( tryAgain ) { |
177 | if ( !bupDir.exists() ) { | 177 | if ( !bupDir.exists() ) { |
178 | KBackupPrefs noDir( i18n("<b>Backup directory does not exist: </b>") + dp.right(30)); | 178 | QString bd = dp.right(25); |
179 | if ( dp.length() > 25 ) | ||
180 | bd = "..." + bd; | ||
181 | KBackupPrefs noDir( i18n("<b>Backup directory does not exist: </b>") + bd); | ||
179 | if ( !noDir.exec() ) return 3; | 182 | if ( !noDir.exec() ) return 3; |
180 | if ( noDir.againTomorrow() ) { | 183 | if ( noDir.againTomorrow() ) { |
181 | return 0; | 184 | return 0; |
182 | } else if ( noDir.later() ) { | 185 | } else if ( noDir.later() ) { |
183 | return 3; | 186 | return 3; |
184 | } else if ( !noDir.again() ) { | 187 | } else if ( !noDir.again() ) { |
185 | return 2; | 188 | return 2; |
186 | } | 189 | } |
187 | } else { | 190 | } else { |
188 | tryAgain = false; | 191 | tryAgain = false; |
189 | } | 192 | } |
190 | } | 193 | } |
191 | // we have a valid dir! | 194 | // we have a valid dir! |
192 | QStringList allFileList = bupDir.entryList(QDir::Files); | 195 | QStringList allFileList = bupDir.entryList(QDir::Files); |
193 | QFileInfo fileInfo ( fn ); | 196 | QFileInfo fileInfo ( fn ); |
194 | QString fName = fileInfo.fileName (); | 197 | QString fName = fileInfo.fileName (); |
195 | QStringList fileList; | 198 | QStringList fileList; |
196 | 199 | ||
197 | int i; | 200 | int i; |
198 | for ( i = 0; i < allFileList.count(); ++i ) { | 201 | for ( i = 0; i < allFileList.count(); ++i ) { |
199 | QString fi = allFileList[i]; | 202 | QString fi = allFileList[i]; |
200 | if ( fi. find( fName ) > -1 ) | 203 | if ( fi. find( fName ) > -1 ) |
201 | fileList.append( fi ); | 204 | fileList.append( fi ); |
202 | } | 205 | } |