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
=== modified file 'po/unity-plugin-scopes.pot'
--- po/unity-plugin-scopes.pot 2015-03-04 10:10:56 +0000
+++ po/unity-plugin-scopes.pot 2015-04-29 10:00:38 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2015-03-04 11:02+0100\n"11"POT-Creation-Date: 2015-04-29 10:20+0200\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
1515
=== modified file 'src/Unity/scope.cpp'
--- src/Unity/scope.cpp 2015-03-20 14:44:32 +0000
+++ src/Unity/scope.cpp 2015-04-29 10:00:38 +0000
@@ -267,7 +267,7 @@
267 {267 {
268 m_queryUserData.reset(nullptr);268 m_queryUserData.reset(nullptr);
269 }269 }
270 setSearchQuery(QString::fromStdString(query.query_string()));270 setSearchQueryString(QString::fromStdString(query.query_string()));
271}271}
272272
273void Scope::executeCannedQuery(unity::scopes::CannedQuery const& query, bool allowDelayedActivation)273void Scope::executeCannedQuery(unity::scopes::CannedQuery const& query, bool allowDelayedActivation)
@@ -1031,6 +1031,16 @@
10311031
1032void Scope::setSearchQuery(const QString& search_query)1032void Scope::setSearchQuery(const QString& search_query)
1033{1033{
1034 // this method is called by the shell when user types in search string,
1035 // it needs to reset canned query user data.
1036 if (m_searchQuery.isNull() || search_query != m_searchQuery) {
1037 m_queryUserData.reset(nullptr);
1038 }
1039 setSearchQueryString(search_query);
1040}
1041
1042void Scope::setSearchQueryString(const QString& search_query)
1043{
1034 /* Checking for m_searchQuery.isNull() which returns true only when the string1044 /* Checking for m_searchQuery.isNull() which returns true only when the string
1035 has never been set is necessary because when search_query is the empty1045 has never been set is necessary because when search_query is the empty
1036 string ("") and m_searchQuery is the null string,1046 string ("") and m_searchQuery is the null string,
10371047
=== modified file 'src/Unity/scope.h'
--- src/Unity/scope.h 2015-03-20 14:44:32 +0000
+++ src/Unity/scope.h 2015-04-29 10:00:38 +0000
@@ -171,6 +171,7 @@
171 Scope::Ptr findTempScope(QString const& id) const;171 Scope::Ptr findTempScope(QString const& id) const;
172172
173 bool loginToAccount(QString const& scope_id, QString const& service_name, QString const& service_type, QString const& provider_name);173 bool loginToAccount(QString const& scope_id, QString const& service_name, QString const& service_type, QString const& provider_name);
174 void setSearchQueryString(const QString& search_query);
174175
175public Q_SLOTS:176public Q_SLOTS:
176 void invalidateResults();177 void invalidateResults();

Subscribers

People subscribed via source and target branches

to all changes: