7 Module implementing a dialog to add RSS feeds. |
7 Module implementing a dialog to add RSS feeds. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 from PyQt5.QtCore import QUrl, qVersion |
12 from PyQt5.QtCore import QUrl |
13 from PyQt5.QtWidgets import QDialog, QPushButton, QLabel |
13 from PyQt5.QtWidgets import QDialog, QPushButton, QLabel |
14 |
14 |
15 from E5Gui import E5MessageBox |
15 from E5Gui import E5MessageBox |
16 |
16 |
17 from .Ui_FeedsDialog import Ui_FeedsDialog |
17 from .Ui_FeedsDialog import Ui_FeedsDialog |
61 button = self.sender() |
61 button = self.sender() |
62 urlString = button.feed[1] |
62 urlString = button.feed[1] |
63 url = QUrl(urlString) |
63 url = QUrl(urlString) |
64 if url.isRelative(): |
64 if url.isRelative(): |
65 url = self.__browser.url().resolved(url) |
65 url = self.__browser.url().resolved(url) |
66 if qVersion() >= "5.0.0": |
66 urlString = url.toDisplayString(QUrl.FullyDecoded) |
67 urlString = url.toDisplayString(QUrl.FullyDecoded) |
67 |
68 else: |
|
69 urlString = url.toString() |
|
70 ## if not urlString.startswith("/"): |
|
71 ## urlString = "/" + urlString |
|
72 ## urlString = self.__browser.url().host() + urlString |
|
73 ## tmpUrl = QUrl(urlString) |
|
74 ## if not tmpUrl.scheme(): |
|
75 ## urlString = "http://" + urlString |
|
76 ## tmpUrl = QUrl(urlString) |
|
77 ## if not tmpUrl.scheme() or not tmpUrl.host(): |
|
78 ## return |
|
79 if not url.isValid(): |
68 if not url.isValid(): |
80 return |
69 return |
81 |
70 |
82 if button.feed[0]: |
71 if button.feed[0]: |
83 title = button.feed[0] |
72 title = button.feed[0] |