diff options
author | Markus Goetz <markus@woboq.com> | 2018-03-27 18:42:39 +0300 |
---|---|---|
committer | Camila San <hello@camila.codes> | 2018-05-16 22:03:06 +0300 |
commit | 9ef42b483535985e5011c3ff64d0824cb79e3752 (patch) | |
tree | 1f343eba462b58d21a10bcf676c409a6a36c3723 /src/gui | |
parent | 5e2270bd570c06905c5be953f7d1eaa055d503ac (diff) |
SslButton: Improve speed (especially on macOS) #6031
From 1+n*450msec to 1*450msec
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/sslbutton.cpp | 6 | ||||
-rw-r--r-- | src/gui/sslbutton.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/sslbutton.cpp b/src/gui/sslbutton.cpp index 71433aef4..3f8d979da 100644 --- a/src/gui/sslbutton.cpp +++ b/src/gui/sslbutton.cpp @@ -58,7 +58,7 @@ static bool isSelfSigned(const QSslCertificate &certificate) } QMenu *SslButton::buildCertMenu(QMenu *parent, const QSslCertificate &cert, - const QList<QSslCertificate> &userApproved, int pos) + const QList<QSslCertificate> &userApproved, int pos, const QList<QSslCertificate> &systemCaCertificates) { QString cn = QStringList(cert.subjectInfo(QSslCertificate::CommonName)).join(QChar(';')); QString ou = QStringList(cert.subjectInfo(QSslCertificate::OrganizationalUnitName)).join(QChar(';')); @@ -129,7 +129,7 @@ QMenu *SslButton::buildCertMenu(QMenu *parent, const QSslCertificate &cert, QString certId = cn.isEmpty() ? ou : cn; - if (QSslConfiguration::systemCaCertificates().contains(cert)) { + if (systemCaCertificates.contains(cert)) { txt += certId; } else { if (isSelfSigned(cert)) { @@ -232,7 +232,7 @@ void SslButton::slotUpdateMenu() it.toBack(); int i = 0; while (it.hasPrevious()) { - _menu->addMenu(buildCertMenu(_menu, it.previous(), account->approvedCerts(), i)); + _menu->addMenu(buildCertMenu(_menu, it.previous(), account->approvedCerts(), i, systemCerts)); i++; } } diff --git a/src/gui/sslbutton.h b/src/gui/sslbutton.h index c48f7c3a7..906f4b846 100644 --- a/src/gui/sslbutton.h +++ b/src/gui/sslbutton.h @@ -43,7 +43,7 @@ public slots: private: QMenu *buildCertMenu(QMenu *parent, const QSslCertificate &cert, - const QList<QSslCertificate> &userApproved, int pos); + const QList<QSslCertificate> &userApproved, int pos, const QList<QSslCertificate> &systemCaCertificates); QPointer<AccountState> _accountState; QMenu *_menu; }; |