~zhangew401/scope-aggregator/fix-empty-query-to-clickstore

« back to all changes in this revision

Viewing changes to include/query.h

  • Committer: Kyle Nitzsche
  • Date: 2016-03-03 16:20:10 UTC
  • mfrom: (158.1.2 hints-using-data)
  • Revision ID: kyle.nitzsche@canonical.com-20160303162010-xpszljtnfu1ziwh0
Tags: 4.4
Merge that works withi/requires 1.0 version of hints scope as follows:

Previously when hints quickstart displayed and user tapped "Skip" button
the hints scope set the uri on the Skip button result like so:
scope://com.canonical.scopes.dashboard_dashbiard?q=start

The result was that the "start" string displayed in the agg scope search
box, which is not great.  

The agg scope looked for an incoming query string of "start" and if found
it treated it as signal to dismiss hints quick start (by writing a file
to cache dir, a file that is checked on every refresh).

This merge changes the expectation of the agg scope as follows:

The signal to dismiss hints now takes the form of user_data of 
"hide_quickstart" in the incoming uri, for example:
        std::string data = query().user_data().get_string();
        if (data == "hide_quickstart")
        ... then write the file to dismiss hints.

Show diffs side-by-side

added added

removed removed

Lines of Context:
201
201
    bool uses_hints = false;
202
202
    unity::scopes::ScopeProxy hints_scope;
203
203
    bool hints_quickstart = false;
204
 
    QString hints_is_hidden = "hints_is_hidden";
 
204
    QString hints_file = "hints_is_hidden";
205
205
    QString firstboot = "firstboot";
206
206
 
207
207
    void load_hints();
208
208
    bool hints_exists();
209
209
    void display_hints_quickstart(us::SearchReplyProxy const& upstream_reply_);
210
210
    bool show_hints(us::SearchReplyProxy const& upstream_reply_);
211
 
    bool is_hints_quickstart_dismissed();
 
211
    bool hints_hidden();
212
212
    void dismiss_hints_quickstart();
213
213
    std::string HINTS_SCOPE_ID;//fqn of hints scope
214
214
    std::string HINTS_THIS_SCOPE;//tells hints which agg scope this is