diff ui/createcertlistdialog.cpp @ 515:9d3880db6ba7

Improve error handlig and persist user decisions
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 28 Apr 2014 14:02:40 +0000
parents 9cd28df2c4ce
children a097dd86cb4d
line wrap: on
line diff
--- a/ui/createcertlistdialog.cpp	Mon Apr 28 13:59:55 2014 +0000
+++ b/ui/createcertlistdialog.cpp	Mon Apr 28 14:02:40 2014 +0000
@@ -258,7 +258,16 @@
         return;
     }
 
-    if (!outputFile.copy(archiveDir.filePath("current_certificates.txt"))) {
+    QString curCerts = archiveDir.filePath("current_certificates.txt");
+
+    if (QFile::exists(curCerts)) {
+        if (!QFile::remove(curCerts)) {
+            showErrorMessage(tr("Failed to update current_certificates.txt"));
+            return;
+        }
+    }
+
+    if (!outputFile.copy(curCerts)) {
         showErrorMessage(tr("Failed to write current_certificates file."));
         return;
     }

http://wald.intevation.org/projects/trustbridge/