|
a/src/desktop/unity-lens-recoll/recollscope/rclsearch.py |
|
b/src/desktop/unity-lens-recoll/recollscope/rclsearch.py |
|
... |
|
... |
20 |
|
20 |
|
21 |
def __init__ (self):
|
21 |
def __init__ (self):
|
22 |
Unity.Scope.__init__ (self, dbus_path="/org/recoll/unitylensrecoll/scope/main")
|
22 |
Unity.Scope.__init__ (self, dbus_path="/org/recoll/unitylensrecoll/scope/main")
|
23 |
|
23 |
|
24 |
# Listen for changes and requests
|
24 |
# Listen for changes and requests
|
25 |
self.connect ("notify::active-search", self._on_search_changed)
|
25 |
self.connect("notify::active-search", self._on_search_changed)
|
26 |
self.connect ("notify::active-global-search", self._on_global_search_changed)
|
26 |
self.connect("notify::active-global-search", self._on_global_search_changed)
|
|
|
27 |
self.connect("filters-changed", self._on_search_changed);
|
27 |
|
28 |
|
28 |
# Bliss loaded the apps_tree menu here, let's connect to
|
29 |
# Bliss loaded the apps_tree menu here, let's connect to
|
29 |
# the index
|
30 |
# the index
|
30 |
self.db = recoll.connect()
|
31 |
self.db = recoll.connect()
|
31 |
|
32 |
|
|
... |
|
... |
53 |
search.emit("finished")
|
54 |
search.emit("finished")
|
54 |
def reset (self):
|
55 |
def reset (self):
|
55 |
self._do_browse (self.props.results_model)
|
56 |
self._do_browse (self.props.results_model)
|
56 |
self._do_browse (self.props.global_results_model)
|
57 |
self._do_browse (self.props.global_results_model)
|
57 |
|
58 |
|
58 |
def _on_search_changed (self, scope, param_spec):
|
59 |
def _on_search_changed (self, scope, param_spec=None):
|
59 |
search = self.get_search_string()
|
60 |
search = self.get_search_string()
|
60 |
results = scope.props.results_model
|
61 |
results = scope.props.results_model
|
61 |
|
62 |
|
62 |
# print "Search changed to: '%s'" % search
|
63 |
# print "Search changed to: '%s'" % search
|
63 |
|
64 |
|
|
... |
|
... |
113 |
|
114 |
|
114 |
model.clear ()
|
115 |
model.clear ()
|
115 |
if search_string == "":
|
116 |
if search_string == "":
|
116 |
return True
|
117 |
return True
|
117 |
|
118 |
|
|
|
119 |
fcat = self.get_filter("rclcat")
|
|
|
120 |
for option in fcat.options:
|
|
|
121 |
if option.props.active:
|
|
|
122 |
search_string += " rclcat:" + option.props.id
|
|
|
123 |
|
118 |
# Do the recoll thing
|
124 |
# Do the recoll thing
|
119 |
query = self.db.query()
|
125 |
query = self.db.query()
|
120 |
try:
|
126 |
try:
|
121 |
nres = query.execute(search_string)
|
127 |
nres = query.execute(search_string)
|
122 |
except:
|
128 |
except:
|