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:
theme_data, main_rect, footer_rect = \
self._theme_dimensions[theme_name]
self.image_manager.deleteImage(theme_data.theme_name)
# if No file do not update cache
if theme_data.background_filename:
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.
"""
QtGui.QWizard.__init__(self, parent)
#FIXME: remove self.thememanager and use self.parent() instead.
self.thememanager = parent
self.setupUi(self)
self.registerFields()

View File

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