Fix regression that made list of books on device un browseable

This commit is contained in:
Kovid Goyal 2008-05-24 10:07:39 -07:00
parent ac1a747754
commit 7e270ac92e

View File

@ -668,7 +668,11 @@ class DeviceBooksModel(BooksModel):
item = self.db[self.map[current.row()]]
cdata = item.thumbnail
if cdata:
data['cover'] = cdata
img = QImage()
img.loadFromData(cdata)
if img.isNull():
img = self.default_image
data['cover'] = img
type = _('Unknown')
ext = os.path.splitext(item.path)[1]
if ext: