comparison 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
comparison
equal deleted inserted replaced
514:ce8325686b09 515:9d3880db6ba7
256 if (!outputFile.copy(archiveDir.filePath(fileName))) { 256 if (!outputFile.copy(archiveDir.filePath(fileName))) {
257 showErrorMessage(tr("Failed Archive a copy.")); 257 showErrorMessage(tr("Failed Archive a copy."));
258 return; 258 return;
259 } 259 }
260 260
261 if (!outputFile.copy(archiveDir.filePath("current_certificates.txt"))) { 261 QString curCerts = archiveDir.filePath("current_certificates.txt");
262
263 if (QFile::exists(curCerts)) {
264 if (!QFile::remove(curCerts)) {
265 showErrorMessage(tr("Failed to update current_certificates.txt"));
266 return;
267 }
268 }
269
270 if (!outputFile.copy(curCerts)) {
262 showErrorMessage(tr("Failed to write current_certificates file.")); 271 showErrorMessage(tr("Failed to write current_certificates file."));
263 return; 272 return;
264 } 273 }
265 274
266 QMessageBox::information(this, "", tr("Saved certificate list:\n%1").arg(fileName)); 275 QMessageBox::information(this, "", tr("Saved certificate list:\n%1").arg(fileName));

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