Azaziah has proposed merging 
lp:~suutari-olli/openlp/prevent-shorter-than-3-char-bible-search into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~suutari-olli/openlp/prevent-shorter-than-3-char-bible-search/+merge/283727

The quick text search is really slow if bad search terms are used.
For an example search “a” will take several minutes to complete and
may even crash the program.

This branch fixes the situation by adding a minimum 
length of 3 characters for Bible text search.


[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-01-Pull/1272/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-02-Functional-Tests/1196/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-03-Interface-Tests/1135/
[←[1;32mSUCCESS←[1;m] 
https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/971/
[←[1;32mSUCCESS←[1;m] 
https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/563/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-05a-Code_Analysis/636/
[←[1;31mFAILURE←[1;m] https://ci.openlp.io/job/Branch-05b-Test_Coverage/505/
Stopping after failure | Do note that Jenkins was broken at the time being.

-- 
Your team OpenLP Core is requested to review the proposed merge of 
lp:~suutari-olli/openlp/prevent-shorter-than-3-char-bible-search into lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/manager.py'
--- openlp/plugins/bibles/lib/manager.py	2015-12-31 22:46:06 +0000
+++ openlp/plugins/bibles/lib/manager.py	2016-01-23 20:04:48 +0000
@@ -344,7 +344,15 @@
                 translate('BiblesPlugin.BibleManager', 'Text Search is not available with Web Bibles.')
             )
             return None
-        if text:
+
+        if not len(text) == 0 and len(text) < 3:
+            self.main_window.information_message(
+                translate('BiblesPlugin.BibleManager', 'Keyword is too short'),
+                translate('BiblesPlugin.BibleManager', 'The keyword you have entered is shorter '
+                                                       'than 3 characters long.\nPlease try again with '
+                                                       'a longer keyword.')
+            )
+        elif text:
             return self.db_cache[bible].verse_search(text)
         else:
             self.main_window.information_message(

_______________________________________________
Mailing list: https://launchpad.net/~openlp-core
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to