~pete-woods/hud/tweak-search-parameters

« back to all changes in this revision

Viewing changes to service/ItemStore.cpp

  • Committer: Pete Woods
  • Date: 2014-02-18 13:35:12 UTC
  • Revision ID: pete.woods@canonical.com-20140218133512-bnrkd5sbd2jr6fpo
Make legacy queries return no results with an empty search string

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
        return result;
151
151
}
152
152
 
153
 
void ItemStore::search(const QString &query, QList<Result> &results) {
 
153
void ItemStore::search(const QString &query,
 
154
                Query::EmptyBehaviour emptyBehaviour, QList<Result> &results) {
154
155
        QStringMatcher stringMatcher(query, Qt::CaseInsensitive);
155
156
 
156
157
        if (query.isEmpty()) {
 
158
                if (emptyBehaviour == Query::EmptyBehaviour::NO_SUGGESTIONS) {
 
159
                        return;
 
160
                }
 
161
 
157
162
                QMap<unsigned int, DocumentID> tempResults;
158
163
 
159
164
                for (auto it(m_items.constBegin()); it != m_items.constEnd(); ++it) {