fixed wrong image being kept in cache when aborting the themeform

This commit is contained in:
Andreas Preikschat 2012-06-17 18:25:56 +02:00
parent 8bb37f158a
commit 2095a6d0d0
3 changed files with 6 additions and 0 deletions

View File

@ -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]
self.image_manager.deleteImage(theme_data.theme_name)
# 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,

View File

@ -54,6 +54,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
The QWidget-derived parent of the wizard. The QWidget-derived parent of the wizard.
""" """
QtGui.QWizard.__init__(self, parent) QtGui.QWizard.__init__(self, parent)
#FIXME: remove self.thememanager and use self.parent() instead.
self.thememanager = parent self.thememanager = parent
self.setupUi(self) self.setupUi(self)
self.registerFields() self.registerFields()

View File

@ -138,13 +138,17 @@ class ThemeManager(QtGui.QWidget):
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'config_updated'), self.configUpdated) QtCore.SIGNAL(u'config_updated'), self.configUpdated)
# Variables # Variables
#FIXME: convert to camelCase.
self.theme_list = [] self.theme_list = []
self.path = AppLocation.get_section_data_path(self.settingsSection) self.path = AppLocation.get_section_data_path(self.settingsSection)
check_directory_exists(self.path) check_directory_exists(self.path)
#FIXME: convert to camelCase.
self.thumb_path = os.path.join(self.path, u'thumbnails') self.thumb_path = os.path.join(self.path, u'thumbnails')
check_directory_exists(self.thumb_path) check_directory_exists(self.thumb_path)
self.themeForm.path = self.path self.themeForm.path = self.path
#FIXME: convert to camelCase.
self.old_background_image = None self.old_background_image = None
#FIXME: convert to camelCase.
self.bad_v1_name_chars = re.compile(r'[%+\[\]]') self.bad_v1_name_chars = re.compile(r'[%+\[\]]')
# Last little bits of setting up # Last little bits of setting up
self.configUpdated() self.configUpdated()