Helpviewer/SslCertificatesDialog.py

changeset 753
e19a516f0a97
parent 752
2ec6ec7cd381
child 762
48190a225699
--- a/Helpviewer/SslCertificatesDialog.py	Tue Dec 14 09:37:17 2010 +0100
+++ b/Helpviewer/SslCertificatesDialog.py	Tue Dec 14 11:35:28 2010 +0100
@@ -7,7 +7,7 @@
 Module implementing a dialog to show and edit all certificates.
 """
 
-from PyQt4.QtCore import pyqtSlot, Qt, QByteArray
+from PyQt4.QtCore import pyqtSlot, Qt
 from PyQt4.QtGui import QDialog, QTreeWidgetItem
 try:
     from PyQt4.QtNetwork import QSslCertificate, QSslSocket, QSslConfiguration
@@ -21,6 +21,7 @@
 from .SslInfoDialog import SslInfoDialog
 
 import Preferences
+import Utilities
 
 class SslCertificatesDialog(QDialog, Ui_SslCertificatesDialog):
     """
@@ -62,10 +63,12 @@
         @param cert certificate to insert (QSslCertificate)
         """
         # step 1: extract the info to be shown
-        organisation = cert.subjectInfo(QSslCertificate.Organization)
+        organisation = Utilities.decodeString(
+            cert.subjectInfo(QSslCertificate.Organization))
         if organisation is None or organisation == "":
             organisation = self.trUtf8("(Unknown)")
-        commonName = cert.subjectInfo(QSslCertificate.CommonName)
+        commonName = Utilities.decodeString(
+            cert.subjectInfo(QSslCertificate.CommonName))
         if commonName is None or commonName == "":
             commonName = self.trUtf8("(Unknown common name)")
         expiryDate = cert.expiryDate().toString("yyyy-MM-dd")
@@ -167,12 +170,12 @@
         @param cert certificate to insert (QSslCertificate)
         """
         # step 1: extract the info to be shown
-        organisation = str(
-            QByteArray(cert.subjectInfo(QSslCertificate.Organization)), 
-            encoding = "utf-8")
+        organisation = Utilities.decodeString(
+            cert.subjectInfo(QSslCertificate.Organization))
         if organisation is None or organisation == "":
             organisation = self.trUtf8("(Unknown)")
-        commonName = cert.subjectInfo(QSslCertificate.CommonName)
+        commonName = Utilities.decodeString(
+            cert.subjectInfo(QSslCertificate.CommonName))
         if commonName is None or commonName == "":
             commonName = self.trUtf8("(Unknown common name)")
         expiryDate = cert.expiryDate().toString("yyyy-MM-dd")

eric ide

mercurial