Merge lp:~stolowski/unity-scopes-shell/reset-user-data into lp:unity-scopes-shell

Proposed by Paweł Stołowski
Status: Superseded
Proposed branch: lp:~stolowski/unity-scopes-shell/reset-user-data
Merge into: lp:unity-scopes-shell
Diff against target: 54 lines (+13/-2)
3 files modified
po/unity-plugin-scopes.pot (+1/-1)
src/Unity/scope.cpp (+11/-1)
src/Unity/scope.h (+1/-0)
To merge this branch: bzr merge lp:~stolowski/unity-scopes-shell/reset-user-data
Reviewer Review Type Date Requested Status
Marcus Tomlinson (community) Approve
Review via email: mp+257732@code.launchpad.net

This proposal has been superseded by a proposal from 2015-04-29.

Commit message

Reset user data set with previously executed canned query when shell calls setSearchQuery() (i.e.user typed a new search). Keeping the previous value and sending it again with new search (which is a user input, so no side-channel data should exists) is a bug that can confuse scopes.

Description of the change

Reset user data set with previously executed canned query when shell calls setSearchQuery() (i.e.user typed a new search). Keeping the previous value and sending it again with new search (which is a user input, so no side-channel data should exists) is a bug that can confuse scopes.

To post a comment you must log in.
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Indeed

review: Approve
210. By Paweł Stołowski

Merged fix-1335761

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'po/unity-plugin-scopes.pot'
2--- po/unity-plugin-scopes.pot 2015-03-04 10:10:56 +0000
3+++ po/unity-plugin-scopes.pot 2015-04-29 10:00:38 +0000
4@@ -8,7 +8,7 @@
5 msgstr ""
6 "Project-Id-Version: PACKAGE VERSION\n"
7 "Report-Msgid-Bugs-To: \n"
8-"POT-Creation-Date: 2015-03-04 11:02+0100\n"
9+"POT-Creation-Date: 2015-04-29 10:20+0200\n"
10 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13
14=== modified file 'src/Unity/scope.cpp'
15--- src/Unity/scope.cpp 2015-03-20 14:44:32 +0000
16+++ src/Unity/scope.cpp 2015-04-29 10:00:38 +0000
17@@ -267,7 +267,7 @@
18 {
19 m_queryUserData.reset(nullptr);
20 }
21- setSearchQuery(QString::fromStdString(query.query_string()));
22+ setSearchQueryString(QString::fromStdString(query.query_string()));
23 }
24
25 void Scope::executeCannedQuery(unity::scopes::CannedQuery const& query, bool allowDelayedActivation)
26@@ -1031,6 +1031,16 @@
27
28 void Scope::setSearchQuery(const QString& search_query)
29 {
30+ // this method is called by the shell when user types in search string,
31+ // it needs to reset canned query user data.
32+ if (m_searchQuery.isNull() || search_query != m_searchQuery) {
33+ m_queryUserData.reset(nullptr);
34+ }
35+ setSearchQueryString(search_query);
36+}
37+
38+void Scope::setSearchQueryString(const QString& search_query)
39+{
40 /* Checking for m_searchQuery.isNull() which returns true only when the string
41 has never been set is necessary because when search_query is the empty
42 string ("") and m_searchQuery is the null string,
43
44=== modified file 'src/Unity/scope.h'
45--- src/Unity/scope.h 2015-03-20 14:44:32 +0000
46+++ src/Unity/scope.h 2015-04-29 10:00:38 +0000
47@@ -171,6 +171,7 @@
48 Scope::Ptr findTempScope(QString const& id) const;
49
50 bool loginToAccount(QString const& scope_id, QString const& service_name, QString const& service_type, QString const& provider_name);
51+ void setSearchQueryString(const QString& search_query);
52
53 public Q_SLOTS:
54 void invalidateResults();

Subscribers

People subscribed via source and target branches

to all changes: