Reverted the "ComponentFormattingOptions" changes done for Qt5 because PyQt4 has changed.

Sat, 06 Oct 2012 17:58:06 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 06 Oct 2012 17:58:06 +0200
changeset 2107
1690f30db6f3
parent 2106
cca04724bff8
child 2108
22e480e4a47e

Reverted the "ComponentFormattingOptions" changes done for Qt5 because PyQt4 has changed.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Helpviewer/GreaseMonkey/GreaseMonkeyManager.py file | annotate | diff | comparison | revisions
Helpviewer/HelpBrowserWV.py file | annotate | diff | comparison | revisions
Helpviewer/HelpUtilities.py file | annotate | diff | comparison | revisions
Helpviewer/WebPlugins/ClickToFlash/ClickToFlash.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Helpviewer/GreaseMonkey/GreaseMonkeyManager.py	Sat Oct 06 14:50:12 2012 +0200
+++ b/Helpviewer/GreaseMonkey/GreaseMonkeyManager.py	Sat Oct 06 17:58:06 2012 +0200
@@ -10,7 +10,7 @@
 import os
 
 from PyQt4.QtCore import pyqtSignal, QObject, QTimer, QFile, QDir, QSettings, QUrl, \
-    QByteArray, qVersion
+    QByteArray
 from PyQt4.QtNetwork import QNetworkAccessManager
 
 from .GreaseMonkeyJavaScript import bootstrap_js
@@ -298,11 +298,7 @@
         """
         if op == QNetworkAccessManager.GetOperation and \
            request.rawHeader("X-Eric5-UserLoadAction") == QByteArray("1"):
-            if qVersion() >= "5.0.0":
-                urlString = request.url().toString(QUrl.ComponentFormattingOptions(
-                    QUrl.RemoveFragment | QUrl.RemoveQuery))
-            else:
-                urlString = request.url().toString(QUrl.RemoveFragment | QUrl.RemoveQuery)
+            urlString = request.url().toString(QUrl.RemoveFragment | QUrl.RemoveQuery)
             if urlString.endswith(".user.js"):
                 self.downloadScript(request)
                 return EmptyNetworkReply(self)
--- a/Helpviewer/HelpBrowserWV.py	Sat Oct 06 14:50:12 2012 +0200
+++ b/Helpviewer/HelpBrowserWV.py	Sat Oct 06 17:58:06 2012 +0200
@@ -789,13 +789,8 @@
                     """ for URL <b>{0}</b>.</p>""").format(name.toString()))
             return
         elif name.scheme() == "javascript":
-            if qVersion() >= "5.0.0":
-                scriptSource = QUrl.fromPercentEncoding(name.toString(
-                    QUrl.ComponentFormattingOptions(
-                        QUrl.TolerantMode | QUrl.RemoveScheme)))
-            else:
-                scriptSource = QUrl.fromPercentEncoding(name.toString(
-                    QUrl.FormattingOptions(QUrl.TolerantMode | QUrl.RemoveScheme)))
+            scriptSource = QUrl.fromPercentEncoding(name.toString(
+                QUrl.FormattingOptions(QUrl.TolerantMode | QUrl.RemoveScheme)))
             self.page().mainFrame().evaluateJavaScript(scriptSource)
             return
         else:
--- a/Helpviewer/HelpUtilities.py	Sat Oct 06 14:50:12 2012 +0200
+++ b/Helpviewer/HelpUtilities.py	Sat Oct 06 17:58:06 2012 +0200
@@ -9,7 +9,7 @@
 
 import os
 
-from PyQt4.QtCore import QUrl, qVersion
+from PyQt4.QtCore import QUrl
 
 
 def getFileNameFromUrl(url):
@@ -19,12 +19,8 @@
     @param url URL (QUrl)
     @return file name (string)
     """
-    if qVersion() >= "5.0.0":
-        fileName = url.toString(QUrl.ComponentFormattingOptions(
-            QUrl.RemoveFragment | QUrl.RemoveQuery | QUrl.RemoveScheme | QUrl.RemovePort))
-    else:
-        fileName = url.toString(QUrl.RemoveFragment | QUrl.RemoveQuery |
-                                QUrl.RemoveScheme | QUrl.RemovePort)
+    fileName = url.toString(QUrl.RemoveFragment | QUrl.RemoveQuery |
+                            QUrl.RemoveScheme | QUrl.RemovePort)
     if fileName.find("/") != -1:
         pos = fileName.rfind("/")
         fileName = fileName[pos:]
--- a/Helpviewer/WebPlugins/ClickToFlash/ClickToFlash.py	Sat Oct 06 14:50:12 2012 +0200
+++ b/Helpviewer/WebPlugins/ClickToFlash/ClickToFlash.py	Sat Oct 06 17:58:06 2012 +0200
@@ -8,7 +8,7 @@
 """
 
 
-from PyQt4.QtCore import pyqtSlot, QUrl, Qt, QByteArray,  QTimer, qVersion
+from PyQt4.QtCore import pyqtSlot, QUrl, Qt, QByteArray,  QTimer
 from PyQt4.QtGui import QWidget, QMenu, QCursor, QDialog, QLabel, QFormLayout
 from PyQt4.QtNetwork import QNetworkRequest
 from PyQt4.QtWebKit import QWebHitTestResult, QWebElement, QWebView, QWebElementCollection
@@ -215,12 +215,8 @@
         if checkString == "":
             checkString = element.attribute("value")
         
-        if qVersion() >= "5.0.0":
-            checkString = view.url().resolved(QUrl(checkString)).toString(
-                QUrl.ComponentFormattingOptions(QUrl.RemoveQuery))
-        else:
-            checkString = view.url().resolved(QUrl(checkString)).toString(
-                QUrl.RemoveQuery)
+        checkString = view.url().resolved(QUrl(checkString)).toString(
+            QUrl.RemoveQuery)
         return self.__url.toEncoded().contains(QByteArray(checkString.encode("utf-8")))
     
     def __checkElement(self, element):

eric ide

mercurial