forked from openlp/openlp
minor clean ups; do not create qimage and then convert to qpixmap, instad create qpixmap directly
This commit is contained in:
parent
3616554a17
commit
dbef87021c
@ -625,14 +625,14 @@ class SlideController(QtGui.QWidget):
|
||||
label.setMargin(4)
|
||||
label.setScaledContents(True)
|
||||
if self.serviceItem.is_command():
|
||||
image = QtGui.QImage(frame[u'image'])
|
||||
label.setPixmap(QtGui.QPixmap(frame[u'image']))
|
||||
else:
|
||||
# If current slide set background to image
|
||||
if framenumber == slideno:
|
||||
self.serviceItem.bg_image_bytes = \
|
||||
self.imageManager.get_image_bytes(frame[u'title'])
|
||||
image = self.imageManager.get_image(frame[u'title'])
|
||||
label.setPixmap(QtGui.QPixmap.fromImage(image))
|
||||
label.setPixmap(QtGui.QPixmap.fromImage(image))
|
||||
self.previewListWidget.setCellWidget(framenumber, 0, label)
|
||||
slideHeight = width * self.parent().renderer.screen_ratio
|
||||
row += 1
|
||||
|
@ -191,7 +191,7 @@ class PresentationMediaItem(MediaManagerItem):
|
||||
doc.load_presentation()
|
||||
preview = doc.get_thumbnail_path(1, True)
|
||||
doc.close_presentation()
|
||||
if not os.path.exists(preview):
|
||||
if not (preview and os.path.exists(preview)):
|
||||
icon = build_icon(u':/general/general_delete.png')
|
||||
else:
|
||||
if validate_thumb(preview, thumb):
|
||||
|
@ -149,7 +149,7 @@ class PresentationDocument(object):
|
||||
the powerpoint file.
|
||||
"""
|
||||
lastimage = self.get_thumbnail_path(self.get_slide_count(), True)
|
||||
if not os.path.isfile(lastimage):
|
||||
if not (lastimage and os.path.isfile(lastimage)):
|
||||
return False
|
||||
return validate_thumb(self.filepath, lastimage)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user