Merge lp:~gary-wzl77/scope-aggregator/fix_1609230 into lp:scope-aggregator

Proposed by Gary.Wang
Status: Rejected
Rejected by: Kyle Nitzsche
Proposed branch: lp:~gary-wzl77/scope-aggregator/fix_1609230
Merge into: lp:scope-aggregator
Prerequisite: lp:~zhangew401/scope-aggregator/fix-lp-1524597
Diff against target: 90 lines (+7/-15)
5 files modified
4.8-rebase-local-hints-README.md (+1/-2)
data/hints.json (+1/-2)
include/query.h (+0/-1)
src/query.cpp (+1/-7)
src/utils.cpp (+4/-3)
To merge this branch: bzr merge lp:~gary-wzl77/scope-aggregator/fix_1609230
Reviewer Review Type Date Requested Status
Kyle Nitzsche (community) Approve
Penk Chen Pending
Zhang Enwei Pending
Review via email: mp+301867@code.launchpad.net

Commit message

Enable hints display when using child hints scope.

Description of the change

When playing around this branch,
https://code.launchpad.net/~zhangew401/scope-aggregator/fix-lp-1524597
find that hints doesn't work out when using hints child scope rather than new hints definition(local) in aggregator scope.

The above issue affects all aggregator scopes for hints display if using hints child scope.

To post a comment you must log in.
Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

Hi Gary.

Thanks for seeing this. It *did* work at one time but it looks like I dropped it in the end.

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

no need for this anymore - trunk was fixed a while ago. marking rejected but thanks for the fix!

Unmerged revisions

172. By Gary.Wang

Enable hints display when using child hints scope.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '4.8-rebase-local-hints-README.md'
2--- 4.8-rebase-local-hints-README.md 2016-06-27 15:48:22 +0000
3+++ 4.8-rebase-local-hints-README.md 2016-08-03 05:34:48 +0000
4@@ -182,8 +182,7 @@
5 {
6 "hints_scope_id": "com.canonical.scopes.hints_hints",
7 "hints_this_scope": "dashboard",
8- "hints_help": "dashboard",
9- "hints_hide": "start"
10+ "hints_help": "dashboard"
11 }
12 }
13
14
15=== modified file 'data/hints.json'
16--- data/hints.json 2016-07-19 17:32:37 +0000
17+++ data/hints.json 2016-08-03 05:34:48 +0000
18@@ -10,8 +10,7 @@
19 {
20 "hints_scope_id": "com.canonical.scopes.hints_hints",
21 "hints_this_scope": "dashboard",
22- "hints_help": "dashboard",
23- "hints_hide": "start"
24+ "hints_help": "dashboard"
25 },
26 "COMMENT_local": "when 'hints_source' is 'local', the following must be completed",
27 "local":
28
29=== modified file 'include/query.h'
30--- include/query.h 2016-08-03 05:34:48 +0000
31+++ include/query.h 2016-08-03 05:34:48 +0000
32@@ -226,7 +226,6 @@
33
34 std::string HINTS_SCOPE_ID;//fqn of hints scope
35 std::string HINTS_THIS_SCOPE;//tells hints which agg scope this is
36- std::string HINTS_HIDE;//tells hints to stop displaying
37
38 bool has_one_source=false;//true means scope is installed
39 int keyword_cardinality = 5;
40
41=== modified file 'src/query.cpp'
42--- src/query.cpp 2016-07-12 17:14:05 +0000
43+++ src/query.cpp 2016-08-03 05:34:48 +0000
44@@ -172,6 +172,7 @@
45 } else {
46 qDebug() << "=== HINTS CASE 4";
47 show_normal = false;
48+ dismiss_hints_quickstart();// write "hints_is_hidden" cache file
49 }
50 }
51
52@@ -372,13 +373,6 @@
53 HINTS_THIS_SCOPE = sstr(hints_scope[QStringLiteral("hints_this_scope")].toString());
54 else
55 uses_hints = false;
56- //this key is deprecated. it previously specified the query string the hints scope
57- //sent to the agg scope to signal hints quick start should be permanently dismissed.
58- //scope-aggregator 4.4 stopped using this.
59- if (hints_scope.contains(QStringLiteral("hints_hide")))
60- HINTS_HIDE = sstr(hints_scope[QStringLiteral("hints_hide")].toString());
61- else
62- uses_hints = false;
63 }
64 }
65 }
66
67=== modified file 'src/utils.cpp'
68--- src/utils.cpp 2016-08-03 05:34:48 +0000
69+++ src/utils.cpp 2016-08-03 05:34:48 +0000
70@@ -1373,8 +1373,8 @@
71 metadata, reply);
72 }
73
74-bool Query::hints_hidden() {
75-
76+bool Query::hints_hidden()
77+{
78 auto filepath1 = QString::fromStdString(cache_dir_) +"/" + hints_file;
79 auto filepath2 = QString::fromStdString(cache_dir_) +"/" + firstboot;
80 if (QFile::exists(filepath1) || QFile::exists(filepath2))
81@@ -1382,7 +1382,8 @@
82 return false; //don't show hints as fall back
83 }
84
85-void Query::dismiss_hints_quickstart() {
86+void Query::dismiss_hints_quickstart()
87+{
88 qDebug() << "==== HINTS in dismiss()";
89 auto filepath= QString::fromStdString(cache_dir_) +"/" + hints_file;
90 QFile file(filepath);

Subscribers

People subscribed via source and target branches

to all changes: