forked from openlp/openlp
guard against missing image files in themes
Fixes: https://launchpad.net/bugs/1071170
This commit is contained in:
parent
5646183803
commit
fb558935ca
@ -126,6 +126,8 @@ class Image(object):
|
|||||||
self.priority = Priority.Normal
|
self.priority = Priority.Normal
|
||||||
self.source = source
|
self.source = source
|
||||||
self.background = background
|
self.background = background
|
||||||
|
self.timestamp = 0
|
||||||
|
if os.path.exists(path):
|
||||||
self.timestamp = os.stat(path).st_mtime
|
self.timestamp = os.stat(path).st_mtime
|
||||||
self.secondary_priority = Image.secondary_priority
|
self.secondary_priority = Image.secondary_priority
|
||||||
Image.secondary_priority += 1
|
Image.secondary_priority += 1
|
||||||
@ -296,7 +298,9 @@ class ImageManager(QtCore.QObject):
|
|||||||
# Check if the there are any images with the same path and check if the
|
# Check if the there are any images with the same path and check if the
|
||||||
# timestamp has changed.
|
# timestamp has changed.
|
||||||
for image in self._cache.values():
|
for image in self._cache.values():
|
||||||
if image.path == path and image.timestamp != os.stat(path).st_mtime:
|
if os.path.exists(path):
|
||||||
|
if image.path == path and \
|
||||||
|
image.timestamp != os.stat(path).st_mtime:
|
||||||
image.timestamp = os.stat(path).st_mtime
|
image.timestamp = os.stat(path).st_mtime
|
||||||
self._resetImage(image)
|
self._resetImage(image)
|
||||||
# We want only one thread.
|
# We want only one thread.
|
||||||
|
Loading…
Reference in New Issue
Block a user