Revert "Add search-highlight-all option"

There's a better solution: Calling the function twice, once with highlight,
once with mark.

This reverts commit 8812672d7d.
This commit is contained in:
Florian Bruhin 2014-06-26 10:56:31 +02:00
parent 6d0db2af00
commit 4ade32777d
2 changed files with 1 additions and 16 deletions

View File

@ -66,18 +66,13 @@ class SearchManager(QObject):
do_search: If a search should be started. do_search: If a search should be started.
""" """
if self._text is not None and self._text != text: if self._text is not None and self._text != text:
flags = 0 self.do_search.emit('', 0)
if config.get('general', 'search-highlight-all'):
flags |= QWebPage.HighlightAllOccurrences
self.do_search.emit('', flags)
self._text = text self._text = text
self._flags = 0 self._flags = 0
if not config.get('general', 'ignore-case'): if not config.get('general', 'ignore-case'):
self._flags |= QWebPage.FindCaseSensitively self._flags |= QWebPage.FindCaseSensitively
if config.get('general', 'wrap-search'): if config.get('general', 'wrap-search'):
self._flags |= QWebPage.FindWrapsAroundDocument self._flags |= QWebPage.FindWrapsAroundDocument
if config.get('general', 'search-highlight-all'):
self._flags |= QWebPage.HighlightAllOccurrences
if rev: if rev:
self._flags |= QWebPage.FindBackward self._flags |= QWebPage.FindBackward
self.do_search.emit(self._text, self._flags) self.do_search.emit(self._text, self._flags)
@ -110,9 +105,6 @@ class SearchManager(QObject):
Emit: Emit:
do_search: If a search should be started. do_search: If a search should be started.
""" """
if config.get('general', 'search-highlight-all'):
raise CommandError("search-next doesn't work when "
"search-highlight-all is enabled!")
if self._text is not None: if self._text is not None:
for _ in range(count): for _ in range(count):
self.do_search.emit(self._text, self._flags) self.do_search.emit(self._text, self._flags)
@ -127,9 +119,6 @@ class SearchManager(QObject):
Emit: Emit:
do_search: If a search should be started. do_search: If a search should be started.
""" """
if config.get('general', 'search-highlight-all'):
raise CommandError("search-prev doesn't work when "
"search-highlight-all is enabled!")
if self._text is None: if self._text is None:
return return
# The int() here serves as a QFlags constructor to create a copy of the # The int() here serves as a QFlags constructor to create a copy of the

View File

@ -177,10 +177,6 @@ DATA = OrderedDict([
SettingValue(types.Bool(), 'true'), SettingValue(types.Bool(), 'true'),
"Whether to wrap search to the top when arriving at the end."), "Whether to wrap search to the top when arriving at the end."),
('search-highlight-all',
SettingValue(types.Bool(), 'true'),
"Whether to highlight all search matches."),
('startpage', ('startpage',
SettingValue(types.List(), 'http://www.duckduckgo.com'), SettingValue(types.List(), 'http://www.duckduckgo.com'),
"The default page(s) to open at the start, separated by commas."), "The default page(s) to open at the start, separated by commas."),