Merge lp:~knitzsche/scope-aggregator/bug-1508259-start-from-hintview into lp:scope-aggregator

Proposed by Kyle Nitzsche
Status: Merged
Merged at revision: 158
Proposed branch: lp:~knitzsche/scope-aggregator/bug-1508259-start-from-hintview
Merge into: lp:scope-aggregator
Diff against target: 43 lines (+9/-1)
2 files modified
CMakeLists.txt (+1/-1)
src/query.cpp (+8/-0)
To merge this branch: bzr merge lp:~knitzsche/scope-aggregator/bug-1508259-start-from-hintview
Reviewer Review Type Date Requested Status
Gary.Wang Approve
Penk Chen Pending
Jin Pending
Review via email: mp+285806@code.launchpad.net

Description of the change

When a user taps Skip when Hints is displaying, the query string needs to be reset to "" in order to prevent subsearch child scopes with the incoming "start" query string, which this commit does.

To post a comment you must log in.
Revision history for this message
Gary.Wang (gary-wzl77) wrote :

The small *remaining* issue for this bug is hiding query string in search box. Besides this cause, in some other cases, when we do some rich features, which requires continuous page transition from cardview from surface or back and forth by text querying, we really don't wanna show query_string in search box since that makes user confused. For developer, there would be one way to hide querying string and it's shown up always if text querying is made by end-user manually.
But currently there' s no way to deal with this. If unity api team can provide such capability, that would be wonderful.

review: Approve
Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

@Gary, right, there is no way I know of (nor that the unity-api seems to know of) to hide the "start" string used as the signal.

The reason is that the hints scope invokes the agg scope with a uri that looks like this:
scope://com.canonical.scopes.dashboard_dashboard?q=start

That q=start query parameter is passed to the scope as a query string. The agg scope checks for "start" and if it is found, it writes a file to cache that causes hints not to show later.

This approach overloads the query param for two purposes and it is not presently feasible to disambiguate the two use cases.

We need a different approach for hints, which I will take care of this separately from this bug & MR.

Cheers

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2016-02-09 16:11:02 +0000
3+++ CMakeLists.txt 2016-02-11 21:41:32 +0000
4@@ -1,4 +1,4 @@
5-set(VERSION "4.2.1")
6+set(VERSION "4.2.2")
7
8 # Supress qDebug() output
9 ADD_DEFINITIONS( -DQT_NO_DEBUG_OUTPUT )
10
11=== modified file 'src/query.cpp'
12--- src/query.cpp 2015-12-02 22:19:12 +0000
13+++ src/query.cpp 2016-02-11 21:41:32 +0000
14@@ -108,7 +108,12 @@
15 qDebug() << "==== HINTS. query_string" << qstr(query_string);
16
17 if (uses_hints && hints_quickstart && hints_exists() && query_string == HINTS_HIDE)
18+ {
19 dismiss_hints_quickstart();
20+ // when dismissing hints, query string must be set to "" to prevent subsearching
21+ // child scopes.
22+ query_string = "";
23+ }
24
25 if (uses_hints && hints_quickstart && hints_exists() && !is_hints_quickstart_dismissed())
26 {
27@@ -1230,6 +1235,7 @@
28 metadata.set_hint(scope->local_id(), us::Variant("valueMeansNothing"));
29
30 // dispatch subsearches differently depending on whether is keyword or declared scope
31+ qDebug() << "==== QUERY STRING: " << QString::fromStdString(query_string);
32 if (locID == "com.canonical.scopes.clickstore")
33 {
34 for (auto ch : current_child_scopes)
35@@ -1304,6 +1310,8 @@
36 else
37 adj_qry = "";
38
39+ qDebug()<< "=== BUG. adj_qry: " << QString::fromStdString(adj_qry);
40+
41 subsearch
42 (
43 ch,

Subscribers

People subscribed via source and target branches