158 Private method to load the requested QtHelp page. |
158 Private method to load the requested QtHelp page. |
159 |
159 |
160 @param url URL of the requested page |
160 @param url URL of the requested page |
161 @type QUrl |
161 @type QUrl |
162 """ |
162 """ |
163 if self.__engine.findFile(url).isValid(): |
163 data = ( |
164 data = self.__engine.fileData(url) |
164 self.__engine.fileData(url) |
165 else: |
165 if self.__engine.findFile(url).isValid() else |
166 data = QByteArray(self.tr( |
166 QByteArray(self.tr( |
167 """<html>""" |
167 """<html>""" |
168 """<head><title>Error 404...</title></head>""" |
168 """<head><title>Error 404...</title></head>""" |
169 """<body><div align="center"><br><br>""" |
169 """<body><div align="center"><br><br>""" |
170 """<h1>The page could not be found</h1><br>""" |
170 """<h1>The page could not be found</h1><br>""" |
171 """<h3>'{0}'</h3></div></body>""" |
171 """<h3>'{0}'</h3></div></body>""" |
172 """</html>""").format(url.toString()) |
172 """</html>""").format(url.toString()) |
173 .encode("utf-8")) |
173 .encode("utf-8")) |
|
174 ) |
174 |
175 |
175 with E5MutexLocker(self.__mutex): |
176 with E5MutexLocker(self.__mutex): |
176 self.__buffer.setData(data) |
177 self.__buffer.setData(data) |
177 self.__buffer.open(QIODevice.OpenModeFlag.ReadOnly) |
178 self.__buffer.open(QIODevice.OpenModeFlag.ReadOnly) |
178 self.open(QIODevice.OpenModeFlag.ReadOnly) |
179 self.open(QIODevice.OpenModeFlag.ReadOnly) |