Merge lp:~gary-wzl77/unity-scopes-shell/fix_1576311 into lp:unity-scopes-shell

Proposed by Gary.Wang
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 306
Merged at revision: 320
Proposed branch: lp:~gary-wzl77/unity-scopes-shell/fix_1576311
Merge into: lp:unity-scopes-shell
Diff against target: 18 lines (+8/-0)
1 file modified
src/Unity/scope.cpp (+8/-0)
To merge this branch: bzr merge lp:~gary-wzl77/unity-scopes-shell/fix_1576311
Reviewer Review Type Date Requested Status
Paweł Stołowski (community) Approve
Review via email: mp+293727@code.launchpad.net

Commit message

Stop typing timer when reset navigation tag(tapping cancel).
Also make sure relevant signal(searchQueryChanged) is triggered to keep query string updated as query string is empty after tapping cancel

Description of the change

Stop typing timer when reset navigation tag(tapping cancel).
Also make sure relevant signal(searchQueryChanged) is triggered to keep query string updated as query string is empty after tapping cancel

To post a comment you must log in.
306. By Gary.Wang

Only stop typing timer when reset navigation tag(tapping cancel)
Also make sure relevant signal(searchQueryChanged) is triggered to keep query string updated as query string is empty after tapping cancel

Revision history for this message
Paweł Stołowski (stolowski) wrote :

Looks good but I still need to test it in the silo. I'm confused by the need of emitting searchQueryChanged() signal though; did you find any issue if this signal is not emitted here? I checked unity8 code and they reset search themseleves before calling resetPrimaryNavigationTag(), so I'm not sure if this signal is really needed?

review: Needs Information
Revision history for this message
Gary.Wang (gary-wzl77) wrote :

Actually, we need to trigger this signal.
I take unity-scope-tool for example.
If we don't emit searchQueryChanged() signal in following case
  1.query sth by typing some keywords
  2.click 'Cancel'
The textedit of search query will not be updated, which should be cleared up after a query is cancelled.

Revision history for this message
Paweł Stołowski (stolowski) wrote :

> Actually, we need to trigger this signal.
> I take unity-scope-tool for example.
> If we don't emit searchQueryChanged() signal in following case
> 1.query sth by typing some keywords
> 2.click 'Cancel'
> The textedit of search query will not be updated, which should be cleared up
> after a query is cancelled.

Ah, ok, that's interesting. Anyway, this is looking good, no issues spotted in my testing. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Unity/scope.cpp'
2--- src/Unity/scope.cpp 2016-03-17 22:35:44 +0000
3+++ src/Unity/scope.cpp 2016-05-04 09:25:24 +0000
4@@ -1278,6 +1278,14 @@
5 setCurrentNavigationId("");
6 m_filters->update(unity::scopes::FilterState());
7 filterStateChanged();
8+
9+ //1.Do not trigger timeout from m_typingTimer to avoid to execute invalidateResults twice
10+ //after tapping cancel.
11+ //2.Also make sure query string signal is triggered as query string is empty.
12+ if (m_typingTimer.isActive()) {
13+ m_typingTimer.stop();
14+ Q_EMIT searchQueryChanged();
15+ }
16 }
17
18 void Scope::resetFilters()

Subscribers

People subscribed via source and target branches

to all changes: