Reworked according to Andreas' specifications.

This commit is contained in:
Raoul Snyman 2012-05-15 23:06:09 +02:00
parent 8436d9d8c0
commit bfcb6a50b0

View File

@ -330,16 +330,7 @@ class BibleManager(object):
'Import Wizard to install one or more Bibles.') 'Import Wizard to install one or more Bibles.')
}) })
return None return None
language_selection = self.get_meta_data(bible, u'book_name_language') language_selection = self.get_language_selection(bible)
if language_selection:
try:
language_selection = int(language_selection.value)
except (ValueError, TypeError):
language_selection = 0
if language_selection is None or language_selection == -1:
language_selection = QtCore.QSettings().value(
self.settingsSection + u'/bookname language',
QtCore.QVariant(0)).toInt()[0]
reflist = parse_reference(versetext, self.db_cache[bible], reflist = parse_reference(versetext, self.db_cache[bible],
language_selection, book_ref_id) language_selection, book_ref_id)
if reflist: if reflist:
@ -381,12 +372,16 @@ class BibleManager(object):
""" """
log.debug(u'BibleManager.get_language_selection("%s")', bible) log.debug(u'BibleManager.get_language_selection("%s")', bible)
language_selection = self.get_meta_data(bible, u'book_name_language') language_selection = self.get_meta_data(bible, u'book_name_language')
if language_selection and language_selection.value != u'None': if language_selection:
return int(language_selection.value) try:
if language_selection is None or language_selection.value == u'None': language_selection = int(language_selection.value)
return QtCore.QSettings().value( except (ValueError, TypeError):
language_selection = LanguageSelection.Application
if language_selection is None or language_selection == -1:
language_selection = QtCore.QSettings().value(
self.settingsSection + u'/bookname language', self.settingsSection + u'/bookname language',
QtCore.QVariant(0)).toInt()[0] QtCore.QVariant(0)).toInt()[0]
return language_selection
def verse_search(self, bible, second_bible, text): def verse_search(self, bible, second_bible, text):
""" """