[PATCH 1 of 3] Update certificate details on item selection change

Wald Commits scm-commit at wald.intevation.org
Wed Apr 23 12:34:45 CEST 2014


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1398248143 -7200
# Node ID 023b565a02fcd97e10d6e5f0ff71b568ff4b3f68
# Parent  5b4ce22186e985f2bb2b2a2fe8cae4765c5ec0e6
Update certificate details on item selection change.

diff -r 5b4ce22186e9 -r 023b565a02fc ui/mainwindow.cpp
--- a/ui/mainwindow.cpp	Wed Apr 23 11:57:33 2014 +0200
+++ b/ui/mainwindow.cpp	Wed Apr 23 12:15:43 2014 +0200
@@ -294,7 +294,7 @@
     // The certificate list
     QGroupBox *certBox = new QGroupBox(tr("Managed Certificates"));
     mCertListWidget = new QListWidget;
-    connect(mCertListWidget, SIGNAL(itemClicked(QListWidgetItem*)),
+    connect(mCertListWidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
         this, SLOT(showDetails(QListWidgetItem*)));
     certLayout->addWidget(mCertListWidget);
     certBox->setLayout(certLayout);
@@ -521,6 +521,9 @@
 
 void MainWindow::showDetails(QListWidgetItem *item)
 {
+    if (item == NULL) {
+        return;
+    }
     Certificate cert = item->data(CertificateItemDelegate::DataRole).value<Certificate>();
     mSubjectCN->setText(cert.subjectCN());
     mSubjectOU->setText(cert.subjectOU());


More information about the Trustbridge-commits mailing list