[PATCH 1 of 4] Inform the user when logging fails

Wald Commits scm-commit at wald.intevation.org
Fri May 23 18:23:33 CEST 2014


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1400861793 0
# Node ID c9d296f04995982d23bf18c830a9212af7a6755f
# Parent  6677d4ecb6fdc5105fb95e2a0d91d4ec0ae075e9
Inform the user when logging fails.

diff -r 6677d4ecb6fd -r c9d296f04995 ui/administratorwindow.cpp
--- a/ui/administratorwindow.cpp	Fri May 23 10:21:20 2014 +0000
+++ b/ui/administratorwindow.cpp	Fri May 23 16:16:33 2014 +0000
@@ -231,6 +231,8 @@
     QFile logFile(logFilePath);
 
     if (!logFile.open(QIODevice::Append)) {
+        QMessageBox::warning(this, tr("Error!"), tr("Failed to open log file: ") +
+                logFilePath + tr(" Changes are not logged!"));
         qDebug() << "Failed to open log file: " << logFilePath;
         return;
     }
@@ -239,7 +241,8 @@
     newCertList.readList(currentCerts.toLocal8Bit());
     QByteArray entries = createLogEntries(newCertList);
     if(logFile.write(entries) != entries.size()) {
-        qDebug() << "Failed to write log file: " << logFilePath;
+        QMessageBox::warning(this, tr("Error!"), tr("Failed to write log file: ") +
+                logFilePath + tr(" Changes are not logged!"));
         return;
     }
     logFile.close();


More information about the Trustbridge-commits mailing list