forked from openlp/openlp
Fix search error from Web and Android
bzr-revno: 1905 Fixes: https://launchpad.net/bugs/955738
This commit is contained in:
commit
718b943dc9
@ -641,7 +641,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
if item:
|
||||
self.autoSelectId = item.data(QtCore.Qt.UserRole).toInt()[0]
|
||||
|
||||
def search(self, string):
|
||||
def search(self, string, showError=True):
|
||||
"""
|
||||
Performs a plugin specific search for items containing ``string``
|
||||
"""
|
||||
|
@ -1025,12 +1025,13 @@ class BibleMediaItem(MediaManagerItem):
|
||||
return u'{su}[%s]{/su}' % verse_text
|
||||
return u'{su}%s{/su}' % verse_text
|
||||
|
||||
def search(self, string):
|
||||
def search(self, string, showError):
|
||||
"""
|
||||
Search for some Bible verses (by reference).
|
||||
"""
|
||||
bible = unicode(self.quickVersionComboBox.currentText())
|
||||
search_results = self.plugin.manager.get_verses(bible, string, False)
|
||||
search_results = self.plugin.manager.get_verses(bible, string, False,
|
||||
showError)
|
||||
if search_results:
|
||||
versetext = u' '.join([verse.text for verse in search_results])
|
||||
return [[string, versetext]]
|
||||
|
@ -267,7 +267,7 @@ class CustomMediaItem(MediaManagerItem):
|
||||
self.searchTextEdit.clear()
|
||||
self.onSearchTextButtonClick()
|
||||
|
||||
def search(self, string):
|
||||
def search(self, string, showError):
|
||||
search_results = self.manager.get_all_objects(CustomSlide,
|
||||
or_(func.lower(CustomSlide.title).like(u'%' +
|
||||
string.lower() + u'%'),
|
||||
|
@ -234,7 +234,7 @@ class ImageMediaItem(MediaManagerItem):
|
||||
'There was a problem replacing your background, '
|
||||
'the image file "%s" no longer exists.')) % filename)
|
||||
|
||||
def search(self, string):
|
||||
def search(self, string, showError):
|
||||
files = SettingsManager.load_list(self.settingsSection, u'images')
|
||||
results = []
|
||||
string = string.lower()
|
||||
|
@ -310,7 +310,7 @@ class MediaMediaItem(MediaManagerItem):
|
||||
media = filter(lambda x: os.path.splitext(x)[1] in ext, media)
|
||||
return media
|
||||
|
||||
def search(self, string):
|
||||
def search(self, string, showError):
|
||||
files = SettingsManager.load_list(self.settingsSection, u'media')
|
||||
results = []
|
||||
string = string.lower()
|
||||
|
@ -322,7 +322,7 @@ class PresentationMediaItem(MediaManagerItem):
|
||||
return controller
|
||||
return None
|
||||
|
||||
def search(self, string):
|
||||
def search(self, string, showError):
|
||||
files = SettingsManager.load_list(
|
||||
self.settingsSection, u'presentations')
|
||||
results = []
|
||||
|
@ -522,7 +522,7 @@ class HttpConnection(object):
|
||||
plugin = self.parent.plugin.pluginManager.get_plugin_by_name(type)
|
||||
if plugin.status == PluginStatus.Active and \
|
||||
plugin.mediaItem and plugin.mediaItem.hasSearch:
|
||||
results = plugin.mediaItem.search(text)
|
||||
results = plugin.mediaItem.search(text, False)
|
||||
else:
|
||||
results = []
|
||||
return HttpResponse(
|
||||
|
@ -586,7 +586,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
Receiver.send_message(u'service_item_update',
|
||||
u'%s:%s:%s' % (editId, item._uuid, temporary))
|
||||
|
||||
def search(self, string):
|
||||
def search(self, string, showError):
|
||||
"""
|
||||
Search for some songs
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user