comparison ui/certificate.cpp @ 1297:c2fd36cd4093

(issue123) Use gcr-viewer to view certificate details on Linux
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 29 Sep 2014 16:24:05 +0200
parents 265583011f24
children 60e481aa75ca
comparison
equal deleted inserted replaced
1296:13b56e9c7e7b 1297:c2fd36cd4093
8 #include "certificate.h" 8 #include "certificate.h"
9 #include <QDebug> 9 #include <QDebug>
10 #include <QFile> 10 #include <QFile>
11 #include <QStringList> 11 #include <QStringList>
12 #include <QObject> 12 #include <QObject>
13 #include <QProcess>
14 #include <QTemporaryFile>
13 15
14 #include <polarssl/sha1.h> 16 #include <polarssl/sha1.h>
15 17
16 #include "certhelp.h" 18 #include "certhelp.h"
17 #include "listutil.h" 19 #include "listutil.h"
255 return retval; 257 return retval;
256 } 258 }
257 #else 259 #else
258 bool Certificate::showNativeUI(void *parent) 260 bool Certificate::showNativeUI(void *parent)
259 { 261 {
260 qDebug() << "Not implemented."; 262 QTemporaryFile *tmpCert = new QTemporaryFile;
261 return false; 263 tmpCert->open();
264 tmpCert->write("-----BEGIN CERTIFICATE-----\n");
265 tmpCert->write(mBaseLine.right(mBaseLine.size() - 2).toLatin1());
266 tmpCert->write("-----END CERTIFICATE-----\n");
267 tmpCert->close();
268 QStringList args;
269 args << tmpCert->fileName();
270 QProcess *viewer = new QProcess();
271 viewer->setProgram("gcr-viewer");
272 viewer->setArguments(args);
273
274 QObject::connect (viewer, SIGNAL(finished(int, QProcess::ExitStatus)), tmpCert, SLOT(deleteLater()));
275 QObject::connect (viewer, SIGNAL(finished(int, QProcess::ExitStatus)), viewer, SLOT(deleteLater()));
276 viewer->start();
277 return !(!viewer->waitForStarted() || viewer->state() == QProcess::NotRunning);
262 } 278 }
263 #endif 279 #endif

http://wald.intevation.org/projects/trustbridge/