forked from openlp/openlp
use the update mechanism to reset images instead of deleting them (leading to a time advantage when the image did not change)
This commit is contained in:
parent
f2884f0593
commit
d1f1113851
@ -286,15 +286,6 @@ class ImageManager(QtCore.QObject):
|
|||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
return image.image_bytes
|
return image.image_bytes
|
||||||
|
|
||||||
def deleteImage(self, name):
|
|
||||||
"""
|
|
||||||
Delete the Image from the cache.
|
|
||||||
"""
|
|
||||||
log.debug(u'deleteImage %s' % name)
|
|
||||||
if name in self._cache:
|
|
||||||
self._conversionQueue.remove(self._cache[name])
|
|
||||||
del self._cache[name]
|
|
||||||
|
|
||||||
def addImage(self, name, path, source, background):
|
def addImage(self, name, path, source, background):
|
||||||
"""
|
"""
|
||||||
Add image to cache if it is not already there.
|
Add image to cache if it is not already there.
|
||||||
|
@ -134,6 +134,7 @@ class Renderer(object):
|
|||||||
else:
|
else:
|
||||||
theme_data, main_rect, footer_rect = \
|
theme_data, main_rect, footer_rect = \
|
||||||
self._theme_dimensions[theme_name]
|
self._theme_dimensions[theme_name]
|
||||||
|
#FIXME: REMOVE deleteImage() call which will be added soon.
|
||||||
# if No file do not update cache
|
# if No file do not update cache
|
||||||
if theme_data.background_filename:
|
if theme_data.background_filename:
|
||||||
self.image_manager.addImage(theme_data.theme_name,
|
self.image_manager.addImage(theme_data.theme_name,
|
||||||
@ -236,7 +237,6 @@ class Renderer(object):
|
|||||||
# make big page for theme edit dialog to get line count
|
# make big page for theme edit dialog to get line count
|
||||||
serviceItem.add_from_text(VERSE_FOR_LINE_COUNT)
|
serviceItem.add_from_text(VERSE_FOR_LINE_COUNT)
|
||||||
else:
|
else:
|
||||||
self.image_manager.deleteImage(theme_data.theme_name)
|
|
||||||
serviceItem.add_from_text(VERSE)
|
serviceItem.add_from_text(VERSE)
|
||||||
serviceItem.renderer = self
|
serviceItem.renderer = self
|
||||||
serviceItem.raw_footer = FOOTER
|
serviceItem.raw_footer = FOOTER
|
||||||
|
Loading…
Reference in New Issue
Block a user