From a3dd6478791fe920dd0df535c7d347c27e728855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Sat, 14 May 2016 11:31:28 +0000 Subject: [PATCH] read more than one certificate from a file; take file names in command line arguments --- src/certman.hxx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/certman.hxx b/src/certman.hxx index 97db01c..dbf2ce2 100644 --- a/src/certman.hxx +++ b/src/certman.hxx @@ -35,21 +35,21 @@ class CertMan: public QMainWindow, protected Ui::CertMan { SLOT(certificate(QUrl, QSslCertificate))); } bool open(const QString& fileName) { - bool status(true); + bool status(false); QFile file(fileName); file.open(QIODevice::ReadOnly); - while (!file.atEnd()) { - QSslCertificate c(&file); - if (!c.isNull()) { - Certificate* win(new Certificate(_mdi)); - _mdi->addSubWindow(win)->setWindowTitle(QFileInfo(fileName).fileName()); - win->show(); - win->certificate(c); - } else { - status = false; - qDebug()<addSubWindow(win)->setWindowTitle + (c.subjectInfo(QSslCertificate::CommonName).join(", ") + +" ("+QFileInfo(fileName).fileName()+")"); + win->show(); + win->certificate(c); + status = true; } file.close(); return status;