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

« back to all changes in this revision

Viewing changes to src/query.cpp

  • Committer: Zhang Enwei
  • Date: 2016-08-04 05:01:13 UTC
  • Revision ID: enwei.zhang@canonical.com-20160804050113-9cl8atnuh51qxbr5
In r170, when query_store_ is empty, some random scopes will be recommended, we need to fix this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1330
1330
        qDebug() << "==== QUERY STRING: " << QString::fromStdString(query_string);
1331
1331
        if (locID == "com.canonical.scopes.clickstore")
1332
1332
        {
1333
 
            for (auto ch : current_child_scopes)
 
1333
            if (query_store_ != "")
1334
1334
            {
1335
 
                if (ch.id == localId_id_m[locID])
 
1335
                for (auto ch : current_child_scopes)
1336
1336
                {
1337
 
                    qDebug() << "=== subsearch CLICKSTORE scope, locald_ID: " << qstr(locID) << " for: " << QString::fromStdString(query_store_);
1338
 
                    subsearch
1339
 
                    (
1340
 
                        ch,
1341
 
                        query_store_,
1342
 
                        "",
1343
 
                        us::FilterState(),
1344
 
                        metadata,
1345
 
                        replies[i]
1346
 
                    );
1347
 
                    break;
 
1337
                    if (ch.id == localId_id_m[locID])
 
1338
                    {
 
1339
                        qDebug() << "=== subsearch CLICKSTORE scope, locald_ID: " << qstr(locID) << " for: " << QString::fromStdString(query_store_);
 
1340
                        subsearch
 
1341
                        (
 
1342
                            ch,
 
1343
                            query_store_,
 
1344
                            "",
 
1345
                            us::FilterState(),
 
1346
                            metadata,
 
1347
                            replies[i]
 
1348
                        );
 
1349
                        break;
 
1350
                    }
 
1351
 
1348
1352
                }
1349
 
 
1350
1353
            }
1351
1354
        }
1352
1355
        else if (scope->keyword_scope())