eric6/E5Network/E5SslInfoWidget.py

branch
without_py2_and_pyqt4
changeset 7198
684261ef2165
parent 6942
2602857055c5
child 7229
53054eb5b15a
--- a/eric6/E5Network/E5SslInfoWidget.py	Sun Sep 01 17:44:33 2019 +0200
+++ b/eric6/E5Network/E5SslInfoWidget.py	Sun Sep 01 19:40:53 2019 +0200
@@ -15,7 +15,6 @@
 
 import UI.PixmapCache
 import Utilities
-from Globals import qVersionTuple
 
 
 class E5SslInfoWidget(QMenu):
@@ -69,16 +68,10 @@
                 "Warning: this site is NOT carrying a certificate."))
             imageLabel.setPixmap(UI.PixmapCache.getPixmap("securityLow32.png"))
         else:
-            if qVersionTuple() >= (5, 0, 0):
-                valid = not cert.isBlacklisted()
-            else:
-                valid = cert.isValid()
+            valid = not cert.isBlacklisted()
             if valid:
-                if qVersionTuple() >= (5, 0, 0):
-                    txt = ", ".join(
-                        cert.issuerInfo(QSslCertificate.CommonName))
-                else:
-                    txt = cert.issuerInfo(QSslCertificate.CommonName)
+                txt = ", ".join(
+                    cert.issuerInfo(QSslCertificate.CommonName))
                 label.setText(self.tr(
                     "The certificate for this site is valid"
                     " and has been verified by:\n{0}").format(
@@ -152,24 +145,26 @@
                 sslVersion = self.tr("unknown")
                 imageLabel.setPixmap(
                     UI.PixmapCache.getPixmap("securityLow32.png"))
-            if qVersionTuple() >= (5, 0, 0):
-                if proto == QSsl.TlsV1_0:
-                    sslVersion = "TLS 1.0"
-                    imageLabel.setPixmap(
-                        UI.PixmapCache.getPixmap("securityHigh32.png"))
-                elif proto == QSsl.TlsV1_1:
-                    sslVersion = "TLS 1.1"
-                    imageLabel.setPixmap(
-                        UI.PixmapCache.getPixmap("securityHigh32.png"))
-                elif proto == QSsl.TlsV1_2:
+            if proto == QSsl.TlsV1_0:
+                sslVersion = "TLS 1.0"
+                imageLabel.setPixmap(
+                    UI.PixmapCache.getPixmap("securityHigh32.png"))
+            elif proto == QSsl.TlsV1_1:
+                sslVersion = "TLS 1.1"
+                imageLabel.setPixmap(
+                    UI.PixmapCache.getPixmap("securityHigh32.png"))
+            elif proto == QSsl.TlsV1_2:
+                sslVersion = "TLS 1.2"
+                imageLabel.setPixmap(
+                    UI.PixmapCache.getPixmap("securityHigh32.png"))
+            try:
+                # Qt 5.12 and newer
+                if proto == QSsl.TlsV1_2:
                     sslVersion = "TLS 1.2"
                     imageLabel.setPixmap(
                         UI.PixmapCache.getPixmap("securityHigh32.png"))
-            else:
-                if proto == QSsl.TlsV1:
-                    sslVersion = "TLS 1.0"
-                    imageLabel.setPixmap(
-                        UI.PixmapCache.getPixmap("securityHigh32.png"))
+            except AttributeError:
+                pass
             rows += 1
             
             label = QLabel(self)

eric ide

mercurial