Mercurial > trustbridge
comparison ui/administratorwindow.cpp @ 567:75e39c52aa94
Check if cert-list filename is null (user canceled open file dialog).
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 23 May 2014 10:24:51 +0200 |
parents | 8728ae882b6a |
children | c9d296f04995 |
comparison
equal
deleted
inserted
replaced
566:8728ae882b6a | 567:75e39c52aa94 |
---|---|
140 void AdministratorWindow::loadCertificateFile() | 140 void AdministratorWindow::loadCertificateFile() |
141 { | 141 { |
142 QString lastCertFile = mSettings.value("LastCertList", QDir::homePath()).toString(); | 142 QString lastCertFile = mSettings.value("LastCertList", QDir::homePath()).toString(); |
143 QString certFile = QFileDialog::getOpenFileName( | 143 QString certFile = QFileDialog::getOpenFileName( |
144 this, tr("Select certificate list file"), lastCertFile, "*.txt"); | 144 this, tr("Select certificate list file"), lastCertFile, "*.txt"); |
145 if (certFile.isNull()) { | |
146 return; | |
147 } | |
145 mCertList.readList(certFile.toLocal8Bit().constData()); | 148 mCertList.readList(certFile.toLocal8Bit().constData()); |
146 if (!mCertList.isValid()) { | 149 if (!mCertList.isValid()) { |
147 QMessageBox::warning(this, tr("Error!"), tr("Failed to load the certificate list.")); | 150 QMessageBox::warning(this, tr("Error!"), tr("Failed to load the certificate list.")); |
148 } else { | 151 } else { |
149 certificateModel->removeAll(); | 152 certificateModel->removeAll(); |