View Single Post
Old 10-14-2008, 08:58 AM   #10
salty-horse
Wizard
salty-horse ought to be getting tired of karma fortunes by now.salty-horse ought to be getting tired of karma fortunes by now.salty-horse ought to be getting tired of karma fortunes by now.salty-horse ought to be getting tired of karma fortunes by now.salty-horse ought to be getting tired of karma fortunes by now.salty-horse ought to be getting tired of karma fortunes by now.salty-horse ought to be getting tired of karma fortunes by now.salty-horse ought to be getting tired of karma fortunes by now.salty-horse ought to be getting tired of karma fortunes by now.salty-horse ought to be getting tired of karma fortunes by now.salty-horse ought to be getting tired of karma fortunes by now.
 
salty-horse's Avatar
 
Posts: 1,471
Karma: 16638560
Join Date: Sep 2008
Device: Kobo Clara 2E
QWebPage fix

Ubuntu 8.10 Seems to have the QWebPage class in the QtWebKit module instead of Qt, as seen in calibre's source.

I have made this change to the source, and now I get no errors, and ePub cover thumbnails display fine in the GUI:

Code:
=== modified file 'src/calibre/ebooks/metadata/epub.py'
--- src/calibre/ebooks/metadata/epub.py	2008-10-11 00:44:56 +0000
+++ src/calibre/ebooks/metadata/epub.py	2008-10-14 12:53:27 +0000
@@ -10,8 +10,12 @@
 from contextlib import closing
 from ctypes import c_long, byref
 
-from PyQt4.Qt import QWebPage, QUrl, QEventLoop, QSize, QByteArray, QBuffer, \
+from PyQt4.Qt import QUrl, QEventLoop, QSize, QByteArray, QBuffer, \
                      SIGNAL, QPainter, QImage, QObject, QApplication
+try:
+    from PyQt4.Qt import QWebPage
+except ImportError:
+    from PyQt4.QtWebKit import QWebPage
 
 from calibre.utils.PythonMagickWand import ImageMagick, NewMagickWand, MagickGetImageBlob, \
                                            MagickReadImageBlob, MagickTrimImage, MagickSetFormat
salty-horse is offline   Reply With Quote