← Back to team overview

openlp-core team mailing list archive

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

 

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

Requested reviews:
  OpenLP Core (openlp-core)

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

Hello,

Fixed a traceback which is occurs when you "lock" the search and do not select a dual bible (quick tab).

Traceback (most recent call last):
  File "/home/andreas/Projekte/openlp/trunk/openlp/plugins/bibles/lib/mediaitem.py", line 577, in onQuickSearchButton
    self.__checkSecondBible(bible, second_bible)
  File "/home/andreas/Projekte/openlp/trunk/openlp/plugins/bibles/lib/mediaitem.py", line 590, in __checkSecondBible
    item_second_bible = self._decodeQtObject(bitem, 'second_bible')
  File "/home/andreas/Projekte/openlp/trunk/openlp/plugins/bibles/lib/mediaitem.py", line 664, in _decodeQtObject
    obj = reference[QtCore.QString(key)]
TypeError: 'NoneType' object is not subscriptable
-- 
https://code.launchpad.net/~googol-hush/openlp/bibles/+merge/60965
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/bibles into lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2011-05-13 15:34:56 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2011-05-13 20:11:01 +0000
@@ -587,7 +587,13 @@
         Check if the first item is a second bible item or not.
         """
         bitem = self.listView.item(0)
-        item_second_bible = self._decodeQtObject(bitem, 'second_bible')
+        if not bitem.flags() & QtCore.Qt.ItemIsSelectable:
+            # The item is the "No Search Results" item.
+            self.listView.clear()
+            self.displayResults(bible, second_bible)
+            return
+        else:
+            item_second_bible = self._decodeQtObject(bitem, 'second_bible')
         if item_second_bible and second_bible or not item_second_bible and \
             not second_bible:
             self.displayResults(bible, second_bible)


Follow ups