Fixed an issue in the password manager caused by different URL handling of Qt4 and Qt5. 5_5_x

Sat, 05 Jul 2014 17:02:12 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 05 Jul 2014 17:02:12 +0200
branch
5_5_x
changeset 3683
315b61d73cab
parent 3679
e31b1fafad14
child 3689
5b41082e849c

Fixed an issue in the password manager caused by different URL handling of Qt4 and Qt5.

Helpviewer/Passwords/PasswordManager.py file | annotate | diff | comparison | revisions
--- a/Helpviewer/Passwords/PasswordManager.py	Sat Jul 05 14:39:33 2014 +0200
+++ b/Helpviewer/Passwords/PasswordManager.py	Sat Jul 05 17:02:12 2014 +0200
@@ -116,11 +116,14 @@
         @param realm realm to get the credentials for (string)
         @return key string (string)
         """
+        authority = url.authority()
+        if authority.startswith("@"):
+            authority = authority[1:]
         if realm:
             key = "{0}://{1} ({2})".format(
-                url.scheme(), url.authority(), realm)
+                url.scheme(), authority, realm)
         else:
-            key = "{0}://{1}".format(url.scheme(), url.authority())
+            key = "{0}://{1}".format(url.scheme(), authority)
         return key
     
     def getFileName(self):
@@ -434,8 +437,15 @@
         """
         cleanUrl = QUrl(url)
         cleanUrl.setQueryItems([])
+        cleanUrl.setUserInfo("")
+        
+        authority = cleanUrl.authority()
+        if authority.startswith("@"):
+            authority = authority[1:]
+        cleanUrl = QUrl("{0}://{1}{2}".format(
+            cleanUrl.scheme(), authority, cleanUrl.path()))
         cleanUrl.setFragment("")
-        cleanUrl.setUserInfo("")
+        
         return cleanUrl
     
     def __findForm(self, webPage, data, boundary=None):
@@ -454,7 +464,8 @@
             args = self.__extractMultipartQueryItems(data, boundary)
         else:
             argsUrl = QUrl.fromEncoded(
-                QByteArray("foo://bar.com/?" + data.replace(b"+", b"%20")))
+                QByteArray("foo://bar.com/?" + QUrl.fromPercentEncoding(
+                    data.replace(b"+", b"%20"))))
             encodedArgs = argsUrl.queryItems()
             args = set()
             for arg in encodedArgs:

eric ide

mercurial