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:
Andreas Preikschat 2012-06-18 14:27:04 +02:00
parent f2884f0593
commit d1f1113851
2 changed files with 1 additions and 10 deletions

View File

@ -286,15 +286,6 @@ class ImageManager(QtCore.QObject):
time.sleep(0.1)
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):
"""
Add image to cache if it is not already there.

View File

@ -134,6 +134,7 @@ class Renderer(object):
else:
theme_data, main_rect, footer_rect = \
self._theme_dimensions[theme_name]
#FIXME: REMOVE deleteImage() call which will be added soon.
# if No file do not update cache
if theme_data.background_filename:
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
serviceItem.add_from_text(VERSE_FOR_LINE_COUNT)
else:
self.image_manager.deleteImage(theme_data.theme_name)
serviceItem.add_from_text(VERSE)
serviceItem.renderer = self
serviceItem.raw_footer = FOOTER