Merge lp://qastaging/~knitzsche/scope-aggregator/bug-1602141-only-show-help-for-installed into lp://qastaging/scope-aggregator

Proposed by Kyle Nitzsche
Status: Merged
Approved by: Kyle Nitzsche
Approved revision: 174
Merged at revision: 169
Proposed branch: lp://qastaging/~knitzsche/scope-aggregator/bug-1602141-only-show-help-for-installed
Merge into: lp://qastaging/scope-aggregator
Diff against target: 86 lines (+36/-4)
3 files modified
CMakeLists.txt (+1/-1)
data/hints.json (+1/-0)
src/utils.cpp (+34/-3)
To merge this branch: bzr merge lp://qastaging/~knitzsche/scope-aggregator/bug-1602141-only-show-help-for-installed
Reviewer Review Type Date Requested Status
Gary.Wang Needs Fixing
Zhang Enwei (community) Approve
Penk Chen Pending
Review via email: mp+300480@code.qastaging.launchpad.net

Description of the change

do not display quick start help result for any click child scope that is not installed.

To post a comment you must log in.
170. By Kyle Nitzsche

The previous commit handled half of the problem: suppressing irrelevant
quick start resuls by not displaying it when it relates to a click packaged
scope that is not installed.

This commit handles the another case, currently invoked for google.

That is, the Today scope quick start help has a result that
simply allows the user to open Settings > Accounts for Google provider.
This result is not connected to any specific child scope.
With this commit. you can declare in the hints.json file that a result
is not to be displayed in the supplied comma separated list of locales
in the form:
ll_CC (where ll is the lang code and CC is the country code).

For example, this hides the only item in the google-account category
when in two locales: es_ES and fr_FR:

(A more real-world example would be China: zh_CN)

"local":
{
    "content":
    {
        "categories":
        [
            {
                "id": "google-account",
                "_title": "See your events and more from Google.",
                "layout":
                {
                    [...]
                },
                "items": [
                    {
                        "hide_in_locales":"es_ES,fr_FR",
                        "_title": "<b> Review your Google sync settings</b>",
                        "_description": "Adding your Google ...",
                        "art":"google.png",
                        "action": {
                            "_name": "Add account",
                            "uri": "settings:///system/online-accounts"
                        }
                    }
                ]
            },

171. By Kyle Nitzsche

remove debug from log and set ver to 4.12

172. By Kyle Nitzsche

remove a couple qDebug() statemetns.

Revision history for this message
Zhang Enwei (zhangew401) wrote :

Hi Kyle,
For scopes that are using new online account settings, the service name is not the scope id. It is scopeid_providername and it is generated by online-account-hooks2.
Please refer to
http://bazaar.launchpad.net/~facebook-scope-team/facebook-scope/trunk/revision/144#src/query.cpp
https://bazaar.launchpad.net/~hanloon-team/hanloon/unity-scope-fitbit/revision/48#src/fitbit.go
https://developer.ubuntu.com/en/phone/platform/guides/online-accounts-developer-guide/(there are errors in this page)

173. By Kyle Nitzsche

This commit also supports making an online accounts client for child scopes
that have been been migrated to the new online accounts starting with
15.04.4. Such child scopes use a different id when creating the client for them.

before 15.04.4: id is pkg_app
starting with 15.04.4: id is pkg_ap_provider

This commit splits the ServiceName value (from hints.json)
on "_". The scope ID (needed to check if the scope is installed/registered
is the first two tokens (rejoined by "_"). If there is no third token, that
is used to create the online accounts client, thus working for child scopes
not yet migrated to 15.04.4 online accounts.

If there is a third token, it is the provider and it is appended to the
scope id and is used to create the online accounts client, thus supporting
updated child scopes.

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

Note that I tested rev 170 change with:
* fbphotos scope 1.32 (which uses the new post 15.04.4 online accounts)
* photos-scope from here: https://code.launchpad.net/~knitzsche/photos-scope/mr-300480-verification

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

Oops. previous comment should have said I tested rev *173* (not rev 170)

Revision history for this message
Zhang Enwei (zhangew401) wrote :

Look good to me!

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

Hi Kyle
   Thanks for this MP.
   Please see my inline comment.

...
(A more real-world example would be China: zh_CN)
...
This made me LOL.:P

review: Needs Fixing
174. By Kyle Nitzsche

use QStringLiteral
version to 4.11
supress QT debug

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

thanks Gary (for the QStringLiteral reminder) and Enwei (for your reviews). I'll merge this. Cheers

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches