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,7 +625,7 @@ 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:
|
||||
|
@ -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