314 self.__webPages.append(page) |
314 self.__webPages.append(page) |
315 |
315 |
316 self.pagesChanged.emit() |
316 self.pagesChanged.emit() |
317 |
317 |
318 @pyqtSlot(str, bool) |
318 @pyqtSlot(str, bool) |
319 def loadThumbnail(self, url, loadTitle): |
319 def loadThumbnail(self, urlStr, loadTitle): |
320 """ |
320 """ |
321 Public slot to load a thumbnail of the given URL. |
321 Public slot to load a thumbnail of the given URL. |
322 |
322 |
323 @param url URL of the thumbnail (string) |
323 @param urlStr URL of the thumbnail |
|
324 @type str |
324 @param loadTitle flag indicating to get the title for the thumbnail |
325 @param loadTitle flag indicating to get the title for the thumbnail |
325 from the site (boolean) |
326 from the site |
|
327 @type bool |
326 """ |
328 """ |
327 from .PageThumbnailer import PageThumbnailer |
329 from .PageThumbnailer import PageThumbnailer |
328 |
330 |
329 if not url: |
331 if not urlStr: |
330 return |
332 return |
331 |
333 |
|
334 url = QUrl.fromEncoded(urlStr.encode("utf-8")) |
|
335 if not url.host(): |
|
336 return |
|
337 |
332 thumbnailer = PageThumbnailer(self) |
338 thumbnailer = PageThumbnailer(self) |
333 thumbnailer.setUrl(QUrl.fromEncoded(url.encode("utf-8"))) |
339 thumbnailer.setUrl(url) |
334 thumbnailer.setLoadTitle(loadTitle) |
340 thumbnailer.setLoadTitle(loadTitle) |
335 thumbnailer.thumbnailCreated.connect( |
341 thumbnailer.thumbnailCreated.connect( |
336 lambda imag: self.__thumbnailCreated(imag, thumbnailer) |
342 lambda imag: self.__thumbnailCreated(imag, thumbnailer) |
337 ) |
343 ) |
338 self.__thumbnailers.append(thumbnailer) |
344 self.__thumbnailers.append(thumbnailer) |