Merge lp:~davidc3/singlet/fix-filters-typeerror into lp:singlet

Proposed by David Callé on 2012-03-07
Status: Merged
Approved by: Michael Hall on 2012-03-07
Approved revision: 18
Merged at revision: 18
Proposed branch: lp:~davidc3/singlet/fix-filters-typeerror
Merge into: lp:singlet
Diff against target: 44 lines (+8/-2)
2 files modified
src/singlet/lens/base.py (+4/-1)
src/singlet/scope/base.py (+4/-1)
To merge this branch: bzr merge lp:~davidc3/singlet/fix-filters-typeerror
Reviewer Review Type Date Requested Status
Michael Hall (community) 2012-03-07 Approve on 2012-03-07
Review via email: mp+96382@code.launchpad.net

Description of the change

Currently, clicking on a filter option generates a TypeError.
This branch fixes it by using "queue_search_changed" (a Unity method to cancel the current search and start a new one with the same search string) when the filters-changed signal is received.

To post a comment you must log in.
Michael Hall (mhall119) wrote :

Good catch, thanks for the fix.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/singlet/lens/base.py'
2--- src/singlet/lens/base.py 2012-01-30 02:15:36 +0000
3+++ src/singlet/lens/base.py 2012-03-07 16:00:30 +0000
4@@ -155,7 +155,7 @@
5 # Populate scopes
6 self._scope = Unity.Scope.new ("%s/main" % self._meta.bus_path)
7 self._scope.connect ("search-changed", self.on_search_changed)
8- self._scope.connect ("filters-changed", self.on_search_changed);
9+ self._scope.connect ("filters-changed", self.on_filtering_changed);
10 if self._meta.search_on_blank:
11
12 self._scope.connect ("active", self.on_search_changed);
13@@ -183,6 +183,9 @@
14 self.search(search_string, results)
15 search.finished()
16
17+ def on_filtering_changed(self, *_):
18+ self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
19+
20 def hide_dash_response(self, uri=''):
21 return Unity.ActivationResponse(handled=Unity.HandledType.HIDE_DASH, goto_uri=uri)
22
23
24=== modified file 'src/singlet/scope/base.py'
25--- src/singlet/scope/base.py 2012-01-30 02:15:36 +0000
26+++ src/singlet/scope/base.py 2012-03-07 16:00:30 +0000
27@@ -95,7 +95,7 @@
28 # Populate scopes
29 self._scope = Unity.Scope.new ("%s" % self._meta.bus_path)
30 self._scope.connect ("search-changed", self.on_search_changed)
31- self._scope.connect ("filters-changed", self.on_search_changed);
32+ self._scope.connect ("filters-changed", self.on_filtering_changed);
33 #if self._meta.search_on_blank:
34 #self._scope.connect ("active", self.on_search_changed);
35
36@@ -117,6 +117,9 @@
37 self.search(search_string, results, cancellable)
38 search.finished()
39
40+ def on_filtering_changed(self, *_):
41+ self._scope.queue_search_changed(Unity.SearchType.DEFAULT)
42+
43 def hide_dash_response(self, uri=''):
44 return Unity.ActivationResponse(handled=Unity.HandledType.HIDE_DASH, goto_uri=uri)
45

Subscribers

People subscribed via source and target branches