Helpviewer/AdBlock/AdBlockSubscription.py

changeset 3702
dabc69b82c7c
parent 3658
edcfadf0152d
child 3776
ccb6eacb50e5
--- a/Helpviewer/AdBlock/AdBlockSubscription.py	Sun Jul 13 16:33:32 2014 +0200
+++ b/Helpviewer/AdBlock/AdBlockSubscription.py	Sun Jul 13 18:40:52 2014 +0200
@@ -113,26 +113,21 @@
         if url.path() != "subscribe":
             return
         
-        self.__title = \
-            QUrl.fromPercentEncoding(url.encodedQueryItemValue("title"))
-        self.__enabled = QUrl.fromPercentEncoding(
-            url.encodedQueryItemValue("enabled")) != "false"
-        self.__location = QByteArray(QUrl.fromPercentEncoding(
-            url.encodedQueryItemValue("location")))
+        urlQuery = QUrlQuery(url)
+        self.__title = urlQuery.queryItemValue("title")
+        self.__enabled = urlQuery.queryItemValue("enabled") != "false"
+        self.__location = QByteArray(urlQuery.queryItemValue("location"))
         
         # Check for required subscription
-        self.__requiresLocation = QUrl.fromPercentEncoding(
-            url.encodedQueryItemValue("requiresLocation"))
-        self.__requiresTitle = QUrl.fromPercentEncoding(
-            url.encodedQueryItemValue("requiresTitle"))
+        self.__requiresLocation = urlQuery.queryItemValue("requiresLocation")
+        self.__requiresTitle = urlQuery.queryItemValue("requiresTitle")
         if self.__requiresLocation and self.__requiresTitle:
             import Helpviewer.HelpWindow
             Helpviewer.HelpWindow.HelpWindow.adBlockManager()\
                 .loadRequiredSubscription(self.__requiresLocation,
                                           self.__requiresTitle)
         
-        lastUpdateByteArray = url.encodedQueryItemValue("lastUpdate")
-        lastUpdateString = QUrl.fromPercentEncoding(lastUpdateByteArray)
+        lastUpdateString = urlQuery.queryItemValue("lastUpdate")
         self.__lastUpdate = QDateTime.fromString(lastUpdateString, Qt.ISODate)
         
         self.__loadRules()

eric ide

mercurial