qtui: Make the debug log a proper dialog
[quassel.git] / src / qtui / sslinfodlg.cpp
index 88ac6b1..584303e 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -80,6 +80,13 @@ void SslInfoDlg::setCurrentCert(int index)
     ui.validity->setText(tr("%1 to %2").arg(cert.effectiveDate().date().toString(Qt::ISODate), cert.expiryDate().date().toString(Qt::ISODate)));
     ui.md5Digest->setText(prettyDigest(cert.digest(QCryptographicHash::Md5)));
     ui.sha1Digest->setText(prettyDigest(cert.digest(QCryptographicHash::Sha1)));
+#if QT_VERSION < 0x050000
+    // Qt 4 doesn't include SHA-2 hashes, so hide the row
+    ui.sha256Label->hide();
+    ui.sha256Digest->hide();
+#else
+    ui.sha256Digest->setText(prettyDigest(cert.digest(QCryptographicHash::Sha256)));
+#endif
 }
 
 // in Qt5, subjectInfo returns a QStringList(); turn this into a comma-separated string instead