← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~googol-hush/openlp/trivial2 into lp:openlp

 

Andreas Preikschat has proposed merging lp:~googol-hush/openlp/trivial2 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~googol-hush/openlp/trivial2/+merge/52234

Hello!

- fix a bug, which occurs when viewing (preview/live) a song without/with incomplete footer.
- clean ups
-- 
https://code.launchpad.net/~googol-hush/openlp/trivial2/+merge/52234
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/trivial2 into lp:openlp.
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py	2011-03-02 18:20:47 +0000
+++ openlp/core/lib/serviceitem.py	2011-03-04 17:52:01 +0000
@@ -88,8 +88,8 @@
         self.audit = u''
         self.items = []
         self.iconic_representation = None
-        self.raw_footer = None
-        self.foot_text = None
+        self.raw_footer = []
+        self.foot_text = u''
         self.theme = None
         self.service_item_type = None
         self._raw_frames = []
@@ -183,9 +183,8 @@
         else:
             log.error(u'Invalid value renderer :%s' % self.service_item_type)
         self.title = clean_tags(self.title)
-        self.foot_text = None
-        if self.raw_footer:
-            self.foot_text = u'<br>'.join(self.raw_footer)
+        self.foot_text = \
+            u'<br>'.join([footer for footer in self.raw_footer if footer])
 
     def add_from_image(self, path, title):
         """

=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2011-02-24 21:07:12 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2011-03-04 17:52:01 +0000
@@ -635,7 +635,6 @@
         bible_text = u''
         old_item = None
         old_chapter = -1
-        raw_footer = []
         raw_slides = []
         raw_title = []
         for item in items:
@@ -656,13 +655,13 @@
             second_text = self._decodeQtObject(bitem, 'second_text')
             verse_text = self.formatVerse(old_chapter, chapter, verse)
             footer = u'%s (%s %s %s)' % (book, version, copyright, permissions)
-            if footer not in raw_footer:
-                raw_footer.append(footer)
+            if footer not in service_item.raw_footer:
+                service_item.raw_footer.append(footer)
             if second_bible:
                 footer = u'%s (%s %s %s)' % (book, second_version,
                     second_copyright, second_permissions)
-                if footer not in raw_footer:
-                    raw_footer.append(footer)
+                if footer not in service_item.raw_footer:
+                    service_item.raw_footer.append(footer)
                 bible_text = u'%s&nbsp;%s\n\n%s&nbsp;%s' % (verse_text, text,
                     verse_text, second_text)
                 raw_slides.append(bible_text.rstrip())
@@ -706,11 +705,6 @@
             service_item.theme = self.settings.bible_theme
         for slide in raw_slides:
             service_item.add_from_text(slide[:30], slide)
-        if service_item.raw_footer:
-            for footer in raw_footer:
-                service_item.raw_footer.append(footer)
-        else:
-            service_item.raw_footer = raw_footer
         return True
 
     def formatTitle(self, start_item, old_item):

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2011-02-25 17:27:06 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2011-03-04 17:52:01 +0000
@@ -330,7 +330,6 @@
 
     def generateSlideData(self, service_item, item=None, xmlVersion=False):
         log.debug(u'generateSlideData (%s:%s)' % (service_item, item))
-        raw_footer = []
         item_id = self._getIdOfItemToGenerate(item, self.remoteSong)
         service_item.add_capability(ItemCapabilities.AllowsEdit)
         service_item.add_capability(ItemCapabilities.AllowsPreview)
@@ -392,16 +391,15 @@
                 service_item.add_from_text(slide[:30], unicode(slide))
         service_item.title = song.title
         author_list = [unicode(author.display_name) for author in song.authors]
-        raw_footer.append(song.title)
-        raw_footer.append(u', '.join(author_list))
-        raw_footer.append(song.copyright)
+        service_item.raw_footer.append(song.title)
+        service_item.raw_footer.append(u', '.join(author_list))
+        service_item.raw_footer.append(song.copyright)
         if QtCore.QSettings().value(u'general/ccli number',
             QtCore.QVariant(u'')).toString():
-            raw_footer.append(unicode(
+            service_item.raw_footer.append(unicode(
                 translate('SongsPlugin.MediaItem', 'CCLI License: ') +
                 QtCore.QSettings().value(u'general/ccli number',
                 QtCore.QVariant(u'')).toString()))
-        service_item.raw_footer = raw_footer
         service_item.audit = [
             song.title, author_list, song.copyright, unicode(song.ccli_number)
         ]


Follow ups