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
=== modified file '4.8-rebase-local-hints-README.md'
--- 4.8-rebase-local-hints-README.md 2016-06-27 15:48:22 +0000
+++ 4.8-rebase-local-hints-README.md 2016-08-03 05:34:48 +0000
@@ -182,8 +182,7 @@
182 {182 {
183 "hints_scope_id": "com.canonical.scopes.hints_hints",183 "hints_scope_id": "com.canonical.scopes.hints_hints",
184 "hints_this_scope": "dashboard",184 "hints_this_scope": "dashboard",
185 "hints_help": "dashboard",185 "hints_help": "dashboard"
186 "hints_hide": "start"
187 }186 }
188 }187 }
189188
190189
=== modified file 'data/hints.json'
--- data/hints.json 2016-07-19 17:32:37 +0000
+++ data/hints.json 2016-08-03 05:34:48 +0000
@@ -10,8 +10,7 @@
10 {10 {
11 "hints_scope_id": "com.canonical.scopes.hints_hints",11 "hints_scope_id": "com.canonical.scopes.hints_hints",
12 "hints_this_scope": "dashboard",12 "hints_this_scope": "dashboard",
13 "hints_help": "dashboard",13 "hints_help": "dashboard"
14 "hints_hide": "start"
15 },14 },
16 "COMMENT_local": "when 'hints_source' is 'local', the following must be completed", 15 "COMMENT_local": "when 'hints_source' is 'local', the following must be completed",
17 "local":16 "local":
1817
=== modified file 'include/query.h'
--- include/query.h 2016-08-03 05:34:48 +0000
+++ include/query.h 2016-08-03 05:34:48 +0000
@@ -226,7 +226,6 @@
226226
227 std::string HINTS_SCOPE_ID;//fqn of hints scope227 std::string HINTS_SCOPE_ID;//fqn of hints scope
228 std::string HINTS_THIS_SCOPE;//tells hints which agg scope this is228 std::string HINTS_THIS_SCOPE;//tells hints which agg scope this is
229 std::string HINTS_HIDE;//tells hints to stop displaying
230229
231 bool has_one_source=false;//true means scope is installed230 bool has_one_source=false;//true means scope is installed
232 int keyword_cardinality = 5;231 int keyword_cardinality = 5;
233232
=== modified file 'src/query.cpp'
--- src/query.cpp 2016-07-12 17:14:05 +0000
+++ src/query.cpp 2016-08-03 05:34:48 +0000
@@ -172,6 +172,7 @@
172 } else {172 } else {
173 qDebug() << "=== HINTS CASE 4";173 qDebug() << "=== HINTS CASE 4";
174 show_normal = false; 174 show_normal = false;
175 dismiss_hints_quickstart();// write "hints_is_hidden" cache file
175 }176 }
176 }177 }
177178
@@ -372,13 +373,6 @@
372 HINTS_THIS_SCOPE = sstr(hints_scope[QStringLiteral("hints_this_scope")].toString());373 HINTS_THIS_SCOPE = sstr(hints_scope[QStringLiteral("hints_this_scope")].toString());
373 else374 else
374 uses_hints = false;375 uses_hints = false;
375 //this key is deprecated. it previously specified the query string the hints scope
376 //sent to the agg scope to signal hints quick start should be permanently dismissed.
377 //scope-aggregator 4.4 stopped using this.
378 if (hints_scope.contains(QStringLiteral("hints_hide")))
379 HINTS_HIDE = sstr(hints_scope[QStringLiteral("hints_hide")].toString());
380 else
381 uses_hints = false;
382 }376 }
383 }377 }
384}378}
385379
=== modified file 'src/utils.cpp'
--- src/utils.cpp 2016-08-03 05:34:48 +0000
+++ src/utils.cpp 2016-08-03 05:34:48 +0000
@@ -1373,8 +1373,8 @@
1373 metadata, reply);1373 metadata, reply);
1374}1374}
13751375
1376bool Query::hints_hidden() {1376bool Query::hints_hidden()
13771377{
1378 auto filepath1 = QString::fromStdString(cache_dir_) +"/" + hints_file;1378 auto filepath1 = QString::fromStdString(cache_dir_) +"/" + hints_file;
1379 auto filepath2 = QString::fromStdString(cache_dir_) +"/" + firstboot;1379 auto filepath2 = QString::fromStdString(cache_dir_) +"/" + firstboot;
1380 if (QFile::exists(filepath1) || QFile::exists(filepath2))1380 if (QFile::exists(filepath1) || QFile::exists(filepath2))
@@ -1382,7 +1382,8 @@
1382 return false; //don't show hints as fall back1382 return false; //don't show hints as fall back
1383}1383}
13841384
1385void Query::dismiss_hints_quickstart() {1385void Query::dismiss_hints_quickstart()
1386{
1386 qDebug() << "==== HINTS in dismiss()";1387 qDebug() << "==== HINTS in dismiss()";
1387 auto filepath= QString::fromStdString(cache_dir_) +"/" + hints_file;1388 auto filepath= QString::fromStdString(cache_dir_) +"/" + hints_file;
1388 QFile file(filepath);1389 QFile file(filepath);

Subscribers

People subscribed via source and target branches

to all changes: