[PATCH 1 of 7] Change current certificates file name. Some cleanups

Wald Commits scm-commit at wald.intevation.org
Wed Apr 23 18:21:53 CEST 2014


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1398267144 0
# Node ID 091ad56c2715b74d474af866ab2b02bdfdb2c4fa
# Parent  1ce835c40eb7479abb8277a8d49967a6192c614c
Change current certificates file name. Some cleanups.

diff -r 1ce835c40eb7 -r 091ad56c2715 ui/administratorwindow.cpp
--- a/ui/administratorwindow.cpp	Wed Apr 23 16:37:17 2014 +0200
+++ b/ui/administratorwindow.cpp	Wed Apr 23 15:32:24 2014 +0000
@@ -32,7 +32,7 @@
 AdministratorWindow::AdministratorWindow() {
     setWindowTitle(tr("TrustBridge Administration"));
     QString path = QStandardPaths::locate(
-        QStandardPaths::DataLocation, QString("certlist_last.txt"));
+        QStandardPaths::DataLocation, QString("current_certificates.txt"));
     mCertList.readList(path.toLocal8Bit());
     createActions();
     createMenuBar();
@@ -138,16 +138,12 @@
 
 void AdministratorWindow::loadCertificateFile()
 {
-    QString path = QStandardPaths::locate(
-        QStandardPaths::DataLocation, QString("certlist_last.txt"));
     QString certFile = QFileDialog::getOpenFileName(
-        this, tr("Select certificate list file"), path, "*.txt");
-    qDebug() << "selected: " + certFile;
+        this, tr("Select certificate list file"), QDir::homePath(), "*.txt");
     mCertList.readList(certFile.toLocal8Bit().constData());
     if (!mCertList.isValid()) {
         qDebug() << "Not a valid list.";
-    }
-    else {
+    } else {
         certificateModel->removeAll();
         loadCertificateTable();
     }
@@ -162,7 +158,7 @@
 void AdministratorWindow::addCertificates()
 {
     QStringList certFiles = QFileDialog::getOpenFileNames(
-        this, tr("Select certificate"), QDir::homePath(), "*.pem *.der");
+        this, tr("Select certificate"), QDir::homePath(), "*.pem *.der *.crt");
     for (int i = 0; i < certFiles.size(); i++) {
         QString certFile = certFiles.at(i);
         QList<Certificate> certs = Certificate::fromFileName(certFile);


More information about the Trustbridge-commits mailing list