summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtCertificateViewerDialog.cpp29
-rw-r--r--Swift/QtUI/QtUtilities.cpp9
-rw-r--r--Swift/QtUI/SConscript2
3 files changed, 29 insertions, 11 deletions
diff --git a/Swift/QtUI/QtCertificateViewerDialog.cpp b/Swift/QtUI/QtCertificateViewerDialog.cpp
index 15a52ba..8108978 100644
--- a/Swift/QtUI/QtCertificateViewerDialog.cpp
+++ b/Swift/QtUI/QtCertificateViewerDialog.cpp
@@ -4,14 +4,22 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include "QtCertificateViewerDialog.h"
#include "ui_QtCertificateViewerDialog.h"
#include <Swiften/Base/foreach.h>
-#include <QTreeWidgetItem>
-#include <QLabel>
#include <QDateTime>
+#include <QLabel>
+#include <QString>
+#include <QStringList>
+#include <QTreeWidgetItem>
namespace Swift {
@@ -48,7 +56,7 @@ void QtCertificateViewerDialog::setCertificateChain(const std::vector<Certificat
if (currentChain.size() > 1) {
QTreeWidgetItem* parent = root;
for (int n = 1; n < currentChain.size(); n++) {
- QTreeWidgetItem* link = new QTreeWidgetItem(parent, QStringList(QString("↳ ") + currentChain.at(n).subjectInfo(QSslCertificate::CommonName)));
+ QTreeWidgetItem* link = new QTreeWidgetItem(parent, QStringList(QString("↳ ") + (QStringList(currentChain.at(n).subjectInfo(QSslCertificate::CommonName)).join(", "))));
link->setExpanded(true);
link->setData(0, Qt::UserRole, QVariant(n));
parent = link;
@@ -74,7 +82,8 @@ void QtCertificateViewerDialog::currentItemChanged(QTreeWidgetItem* current, QTr
#define ADD_FIELD( TITLE, VALUE) \
ui->certGridLayout->addWidget(new QLabel(TITLE), rowCount, 0, 1, 1, Qt::AlignRight); \
- valueLabel = new QLabel(VALUE); \
+ valueLabel = new QLabel(); \
+ valueLabel->setText(QStringList(VALUE).join(", ")); \
valueLabel->setTextFormat(Qt::PlainText); \
valueLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); \
ui->certGridLayout->addWidget(valueLabel, rowCount++, 1, 1, 1, Qt::AlignLeft);
@@ -106,10 +115,16 @@ void QtCertificateViewerDialog::setCertificateDetails(const QSslCertificate& cer
ADD_FIELD(tr("Country"), cert.subjectInfo(QSslCertificate::CountryName));
ADD_FIELD(tr("State"), cert.subjectInfo(QSslCertificate::StateOrProvinceName));
- if (!cert.alternateSubjectNames().empty()) {
+#if QT_VERSION < 0x050000
+ QMultiMap<QSsl::AlternateNameEntryType, QString> altNames = cert.alternateSubjectNames();
+#define SANTYPE QSsl::AlternateNameEntryType
+#else
+ QMultiMap<QSsl::AlternativeNameEntryType, QString> altNames = cert.subjectAlternativeNames();
+#define SANTYPE QSsl::AlternativeNameEntryType
+#endif
+ if (!altNames.empty()) {
ADD_SECTION(tr("Alternate Subject Names"));
- QMultiMap<QSsl::AlternateNameEntryType, QString> altNames = cert.alternateSubjectNames();
- foreach (const QSsl::AlternateNameEntryType &type, altNames.uniqueKeys()) {
+ foreach (const SANTYPE &type, altNames.uniqueKeys()) {
foreach (QString name, altNames.values(type)) {
if (type == QSsl::EmailEntry) {
ADD_FIELD(tr("E-mail Address"), name);
diff --git a/Swift/QtUI/QtUtilities.cpp b/Swift/QtUI/QtUtilities.cpp
index 70686e7..b4b1b09 100644
--- a/Swift/QtUI/QtUtilities.cpp
+++ b/Swift/QtUI/QtUtilities.cpp
@@ -1,18 +1,19 @@
/*
- * Copyright (c) 2010-2013 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include "QtUtilities.h"
-#include <QTextDocument>
-#include <QWidget>
+#include <QtGui>
#if defined (Q_OS_UNIX) && !defined(Q_OS_MAC)
#include <QX11Info>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#endif
+#include <QTextDocument>
+#include <QWidget>
#include "Swift/Controllers/ApplicationInfo.h"
@@ -20,7 +21,7 @@ namespace QtUtilities {
void setX11Resource(QWidget* widget, const QString& c) {
-#if defined (Q_OS_UNIX) && !defined(Q_OS_MAC)
+#if defined (Q_OS_UNIX) && !defined(Q_OS_MAC) && QT_VERSION < 0x050000
char res_class[] = SWIFT_APPLICATION_NAME;
XClassHint hint;
QByteArray resName = (QString(SWIFT_APPLICATION_NAME) + "-" + c).toUtf8();
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript
index f3251d2..86b41d3 100644
--- a/Swift/QtUI/SConscript
+++ b/Swift/QtUI/SConscript
@@ -61,6 +61,8 @@ qt4modules = ['QtCore', 'QtWebKit', 'QtGui']
if myenv["qt5"] :
qt_version = '5'
qt4modules += ['QtWidgets', 'QtWebKitWidgets', 'QtMultimedia']
+ if env["PLATFORM"] != "win32" and env["PLATFORM"] != "darwin" :
+ qt4modules += ['QtX11Extras']
else :
qt_version = '4'
if env["PLATFORM"] == "posix" :