Continued porting the web browser. QtWebEngine

Sun, 21 Feb 2016 18:54:14 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 21 Feb 2016 18:54:14 +0100
branch
QtWebEngine
changeset 4761
9d077d20be75
parent 4759
a60eb8619906
child 4762
ea40955a0937

Continued porting the web browser.

- fixed the RSS Feeds manager

Preferences/__init__.py file | annotate | diff | comparison | revisions
WebBrowser/Feeds/FeedsDialog.py file | annotate | diff | comparison | revisions
WebBrowser/Feeds/FeedsManager.py file | annotate | diff | comparison | revisions
--- a/Preferences/__init__.py	Sat Feb 20 17:45:40 2016 +0100
+++ b/Preferences/__init__.py	Sun Feb 21 18:54:14 2016 +0100
@@ -2819,7 +2819,7 @@
     elif key == "RssFeeds":
         # value is list of tuples of (URL, title, icon)
         prefClass.settings.remove("WebBrowser/" + key)
-        prefClass.settings.beginWriteArray("Help/" + key, len(value))
+        prefClass.settings.beginWriteArray("WebBrowser/" + key, len(value))
         index = 0
         for v in value:
             prefClass.settings.setArrayIndex(index)
--- a/WebBrowser/Feeds/FeedsDialog.py	Sat Feb 20 17:45:40 2016 +0100
+++ b/WebBrowser/Feeds/FeedsDialog.py	Sun Feb 21 18:54:14 2016 +0100
@@ -9,7 +9,7 @@
 
 from __future__ import unicode_literals
 
-from PyQt5.QtCore import QUrl
+from PyQt5.QtCore import QUrl, qVersion
 from PyQt5.QtWidgets import QDialog, QPushButton, QLabel
 
 from E5Gui import E5MessageBox
@@ -61,16 +61,21 @@
         button = self.sender()
         urlString = button.feed[1]
         url = QUrl(urlString)
-        if not url.host():
-            if not urlString.startswith("/"):
-                urlString = "/" + urlString
-            urlString = self.__browser.url().host() + urlString
-            tmpUrl = QUrl(urlString)
-            if not tmpUrl.scheme():
-                urlString = "http://" + urlString
-            tmpUrl = QUrl(urlString)
-            if not tmpUrl.scheme() or not tmpUrl.host():
-                return
+        if url.isRelative():
+            url = self.__browser.url().resolved(url)
+            if qVersion() >= "5.0.0":
+                urlString = url.toDisplayString(QUrl.FullyDecoded)
+            else:
+                urlString = url.toString()
+##            if not urlString.startswith("/"):
+##                urlString = "/" + urlString
+##            urlString = self.__browser.url().host() + urlString
+##            tmpUrl = QUrl(urlString)
+##            if not tmpUrl.scheme():
+##                urlString = "http://" + urlString
+##            tmpUrl = QUrl(urlString)
+##            if not tmpUrl.scheme() or not tmpUrl.host():
+##                return
         if not url.isValid():
             return
         
--- a/WebBrowser/Feeds/FeedsManager.py	Sat Feb 20 17:45:40 2016 +0100
+++ b/WebBrowser/Feeds/FeedsManager.py	Sun Feb 21 18:54:14 2016 +0100
@@ -17,7 +17,6 @@
 from PyQt5.QtGui import QIcon, QCursor
 from PyQt5.QtWidgets import QDialog, QTreeWidgetItem, QMenu, QApplication
 from PyQt5.QtNetwork import QNetworkRequest, QNetworkReply
-##from PyQt5.QtWebKit import QWebSettings
 
 from E5Gui import E5MessageBox
 

eric ide

mercurial