openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #01609
[Merge] lp:~trb143/openlp/working into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/working into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Fix pseudo memory issue by clearing the cache when finished in the service item.
Improve the slidecontroller tagging of verses.
--
https://code.launchpad.net/~trb143/openlp/working/+merge/25849
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/working into lp:openlp.
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2010-05-07 18:29:17 +0000
+++ openlp/core/ui/servicemanager.py 2010-05-23 16:18:26 +0000
@@ -711,6 +711,10 @@
self.regenerateServiceItems()
def regenerateServiceItems(self):
+ """
+ Rebuild the service list as things have changed and a
+ repaint is the easiest way to do this.
+ """
#force reset of renderer as theme data has changed
self.parent.RenderManager.themedata = None
if self.serviceItems:
@@ -963,4 +967,4 @@
data_item[u'notes'] = unicode(service_item.notes)
data_item[u'selected'] = (item == curitem)
data.append(data_item)
- Receiver.send_message(u'servicemanager_list_response', data)
\ No newline at end of file
+ Receiver.send_message(u'servicemanager_list_response', data)
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2010-05-17 18:39:28 +0000
+++ openlp/core/ui/slidecontroller.py 2010-05-23 16:18:26 +0000
@@ -516,6 +516,9 @@
#Set pointing cursor when we have somthing to point at
self.PreviewListWidget.setCursor(QtCore.Qt.PointingHandCursor)
before = time.time()
+ #Clear the old serviceItem cache to release memory
+ if self.serviceItem:
+ self.serviceItem.cache = []
self.serviceItem = serviceItem
self.PreviewListWidget.clear()
self.PreviewListWidget.setRowCount(0)
@@ -531,8 +534,7 @@
slideHeight = 0
#It is a based Text Render
if self.serviceItem.is_text():
- if frame[u'verseTag'] is not None:
- #only load the slot once
+ if frame[u'verseTag']:
bits = frame[u'verseTag'].split(u':')
tag = None
#If verse handle verse number else tag only
@@ -545,13 +547,13 @@
tag = bits[0]
tag1 = tag
row = bits[0][0:1]
- if self.isLive:
- if tag1 not in self.slideList:
- self.slideList[tag1] = framenumber
- self.SongMenu.menu().addAction(self.trUtf8(u'%s'%tag1),
- self.onSongBarHandler)
else:
row += 1
+ if self.isLive and frame[u'verseTag'] is not None:
+ if tag1 not in self.slideList:
+ self.slideList[tag1] = framenumber
+ self.SongMenu.menu().addAction(self.trUtf8(u'%s'%tag1),
+ self.onSongBarHandler)
item.setText(frame[u'text'])
else:
label = QtGui.QLabel()
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2010-05-18 21:18:52 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2010-05-23 16:18:26 +0000
@@ -323,7 +323,9 @@
#no verse list or only 1 space (in error)
if not song.verse_order or not song.verse_order.strip():
for verse in verseList:
- service_item.add_from_text(verse[1][:30], unicode(verse[1]))
+ verseTag = u'%s:%s' % (verse[0][u'type'], verse[0][u'label'])
+ service_item.add_from_text(\
+ verse[1][:30], unicode(verse[1]), verseTag)
else:
#Loop through the verse list and expand the song accordingly.
for order in song.verse_order.upper().split(u' '):
Follow ups