openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #01925
[Merge] lp:~raoul-snyman/openlp/bug-fixes into lp:openlp
Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/bug-fixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Fix bug #596506
--
https://code.launchpad.net/~raoul-snyman/openlp/bug-fixes/+merge/28013
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/bug-fixes into lp:openlp.
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2010-06-18 05:58:40 +0000
+++ openlp/core/lib/serviceitem.py 2010-06-20 11:27:27 +0000
@@ -90,7 +90,7 @@
self.from_plugin = False
self.capabilities = []
self.is_valid = True
- self.cache = []
+ self.cache = {}
self.icon = None
def add_capability(self, capability):
@@ -129,7 +129,7 @@
"""
log.debug(u'Render called')
self._display_frames = []
- self.cache = []
+ self.clear_cache()
if self.service_item_type == ServiceItemType.Text:
log.debug(u'Formatting slides')
if self.theme is None:
@@ -149,7 +149,8 @@
self._display_frames.append({u'title': title,
u'text': lines.rstrip(),
u'verseTag': slide[u'verseTag'] })
- self.cache.insert(len(self._display_frames), None)
+ if len(self._display_frames) in self.cache.keys():
+ del self.cache[len(self._display_frames)]
log.log(15, u'Formatting took %4s' % (time.time() - before))
elif self.service_item_type == ServiceItemType.Image:
for slide in self._raw_frames:
@@ -172,8 +173,7 @@
else:
self.render_manager.set_override_theme(self.theme)
format = self._display_frames[row][u'text'].split(u'\n')
- #if screen blank then do not display footer
- if len(self.cache) > 0 and self.cache[row] is not None:
+ if self.cache.get(row):
frame = self.cache[row]
else:
if format[0]:
@@ -385,3 +385,8 @@
"""
return self._raw_frames[row][u'path']
+ def clear_cache(self):
+ """
+ Clear's the service item's cache.
+ """
+ self.cache = {}
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2010-06-19 04:05:39 +0000
+++ openlp/core/ui/slidecontroller.py 2010-06-20 11:27:27 +0000
@@ -537,7 +537,7 @@
before = time.time()
#Clear the old serviceItem cache to release memory
if self.serviceItem and self.serviceItem is not serviceItem:
- self.serviceItem.cache = []
+ self.serviceItem.clear_cache()
self.serviceItem = serviceItem
self.PreviewListWidget.clear()
self.PreviewListWidget.setRowCount(0)
Follow ups