[PATCH] Check if cert-list filename is null (user canceled open file dialog)
Wald Commits
scm-commit at wald.intevation.org
Fri May 23 10:25:17 CEST 2014
# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1400833491 -7200
# Node ID 75e39c52aa9491e4e5dafa889a4d84475bd65244
# Parent 8728ae882b6a0045e92092a193a579dd1d4a303f
Check if cert-list filename is null (user canceled open file dialog).
diff -r 8728ae882b6a -r 75e39c52aa94 ui/administratorwindow.cpp
--- a/ui/administratorwindow.cpp Thu May 22 18:29:14 2014 +0200
+++ b/ui/administratorwindow.cpp Fri May 23 10:24:51 2014 +0200
@@ -142,6 +142,9 @@
QString lastCertFile = mSettings.value("LastCertList", QDir::homePath()).toString();
QString certFile = QFileDialog::getOpenFileName(
this, tr("Select certificate list file"), lastCertFile, "*.txt");
+ if (certFile.isNull()) {
+ return;
+ }
mCertList.readList(certFile.toLocal8Bit().constData());
if (!mCertList.isValid()) {
QMessageBox::warning(this, tr("Error!"), tr("Failed to load the certificate list."));
More information about the Trustbridge-commits
mailing list