Diffstat (limited to 'pwmanager/pwmanager/pwmdocui.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | pwmanager/pwmanager/pwmdocui.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pwmanager/pwmanager/pwmdocui.cpp b/pwmanager/pwmanager/pwmdocui.cpp index 7b8e0ee..6ddb6f5 100644 --- a/pwmanager/pwmanager/pwmdocui.cpp +++ b/pwmanager/pwmanager/pwmdocui.cpp | |||
@@ -270,12 +270,17 @@ bool PwMDocUi::saveDocUi(PwMDoc *doc) | |||
270 | } else if (ret == e_fileBackup) { | 270 | } else if (ret == e_fileBackup) { |
271 | KMessageBox::error(currentView, | 271 | KMessageBox::error(currentView, |
272 | i18n("Error: Couldn't make backup-file!"), | 272 | i18n("Error: Couldn't make backup-file!"), |
273 | i18n("backup failed")); | 273 | i18n("backup failed")); |
274 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | 274 | doc->timer()->putLock(DocTimer::id_autoLockTimer); |
275 | return false; | 275 | return false; |
276 | } else if (ret == e_noPw || | ||
277 | ret == e_wrongPw || | ||
278 | ret == e_openFile) { | ||
279 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | ||
280 | return false; | ||
276 | } else if (ret != e_success) { | 281 | } else if (ret != e_success) { |
277 | KMessageBox::error(currentView, | 282 | KMessageBox::error(currentView, |
278 | i18n("Error: Couldn't write to file.\n" | 283 | i18n("Error: Couldn't write to file.\n" |
279 | "Please check if you have permission to\n" | 284 | "Please check if you have permission to\n" |
280 | "write to the file in that directory."), | 285 | "write to the file in that directory."), |
281 | i18n("error while writing")); | 286 | i18n("error while writing")); |
@@ -315,13 +320,18 @@ bool PwMDocUi::saveAsDocUi(PwMDoc *doc) | |||
315 | return false; | 320 | return false; |
316 | } | 321 | } |
317 | if (fn.right(4) != ".pwm") | 322 | if (fn.right(4) != ".pwm") |
318 | fn += ".pwm"; | 323 | fn += ".pwm"; |
319 | 324 | ||
320 | PwMerror ret = doc->saveDoc(conf()->confGlobCompression(), &fn); | 325 | PwMerror ret = doc->saveDoc(conf()->confGlobCompression(), &fn); |
321 | if (ret != e_success) { | 326 | if (ret == e_noPw || |
327 | ret == e_wrongPw || | ||
328 | ret == e_openFile) { | ||
329 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | ||
330 | return false; | ||
331 | } else if (ret != e_success) { | ||
322 | KMessageBox::error(currentView, | 332 | KMessageBox::error(currentView, |
323 | i18n("Error: Couldn't write to file.\n" | 333 | i18n("Error: Couldn't write to file.\n" |
324 | "Please check if you have permission to\n" | 334 | "Please check if you have permission to\n" |
325 | "write to the file in that directory."), | 335 | "write to the file in that directory."), |
326 | i18n("error while writing")); | 336 | i18n("error while writing")); |
327 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | 337 | doc->timer()->putLock(DocTimer::id_autoLockTimer); |