← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/bug-766201 into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/bug-766201 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #766201 in OpenLP: "Preview gets messed up if theme edit is canceled"
  https://bugs.launchpad.net/openlp/+bug/766201

For more details, see:
https://code.launchpad.net/~trb143/openlp/bug-766201/+merge/61020

The Image cache was being updates with a null image and this was leading to a corruption in the cache.
Only add a file if it is there!
-- 
https://code.launchpad.net/~trb143/openlp/bug-766201/+merge/61020
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/bug-766201 into lp:openlp.
=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2011-05-13 17:43:38 +0000
+++ openlp/core/lib/renderer.py	2011-05-15 13:45:52 +0000
@@ -162,8 +162,10 @@
             self.theme_data = self.theme_manager.getThemeData(theme)
         self._calculate_default(self.screens.current[u'size'])
         self._build_text_rectangle(self.theme_data)
-        self.image_manager.add_image(self.theme_data.theme_name,
-            self.theme_data.background_filename)
+        # if No file do not update cache
+        if self.theme_data.background_filename:
+            self.image_manager.add_image(self.theme_data.theme_name,
+                self.theme_data.background_filename)
         return self._rect, self._rect_footer
 
     def generate_preview(self, theme_data, force_page=False):


Follow ups