Merge lp:~stolowski/unity-scopes-shell/set-connectivity-status-of-actionmetadata into lp:unity-scopes-shell

Proposed by Paweł Stołowski
Status: Merged
Approved by: Marcus Tomlinson
Approved revision: 306
Merged at revision: 318
Proposed branch: lp:~stolowski/unity-scopes-shell/set-connectivity-status-of-actionmetadata
Merge into: lp:unity-scopes-shell
Diff against target: 50 lines (+13/-0)
3 files modified
src/Unity/previewmodel.cpp (+6/-0)
src/Unity/scope.cpp (+5/-0)
src/Unity/scope.h (+2/-0)
To merge this branch: bzr merge lp:~stolowski/unity-scopes-shell/set-connectivity-status-of-actionmetadata
Reviewer Review Type Date Requested Status
Marcus Tomlinson (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Michi Henning (community) Approve
Review via email: mp+293293@code.launchpad.net

Commit message

Set internet connectivity status in ActionMetadata (previews and preview actions).

Description of the change

Set internet connectivity status in ActionMetadata (previews and preview actions). We currently only do this for SearchMetadata.

To post a comment you must log in.
Revision history for this message
Michi Henning (michihenning) wrote :

Looks good to me, but someone who knows the shell code better should look it over too. Thanks for persisting with this!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Ah, my bad. I totally neglected to consider providing connectivity status via ActionMetadata as well. Thanks Pawel!

review: Approve
307. By Paweł Stołowski

Merged trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Unity/previewmodel.cpp'
2--- src/Unity/previewmodel.cpp 2016-05-05 09:40:58 +0000
3+++ src/Unity/previewmodel.cpp 2016-05-06 07:32:24 +0000
4@@ -548,6 +548,9 @@
5
6 QString formFactor(m_associatedScope ? m_associatedScope->formFactor() : QStringLiteral("phone"));
7 scopes::ActionMetadata metadata(QLocale::system().name().toStdString(), formFactor.toStdString());
8+ if (m_associatedScope) {
9+ metadata.set_internet_connectivity(m_associatedScope->networkManager().isOnline() ? scopes::SearchMetadata::Connected : scopes::SearchMetadata::Disconnected);
10+ }
11 if (!extra_data.is_null()) {
12 metadata.set_scope_data(extra_data);
13 }
14@@ -594,6 +597,9 @@
15 QString formFactor(m_associatedScope ? m_associatedScope->formFactor() : QStringLiteral("phone"));
16 scopes::ActionMetadata metadata(QLocale::system().name().toStdString(), formFactor.toStdString());
17 metadata.set_scope_data(qVariantToScopeVariant(data));
18+ if (m_associatedScope) {
19+ metadata.set_internet_connectivity(m_associatedScope->networkManager().isOnline() ? scopes::SearchMetadata::Connected : scopes::SearchMetadata::Disconnected);
20+ }
21
22 if (m_lastActivation) {
23 m_lastActivation->invalidate();
24
25=== modified file 'src/Unity/scope.cpp'
26--- src/Unity/scope.cpp 2016-05-05 09:41:13 +0000
27+++ src/Unity/scope.cpp 2016-05-06 07:32:24 +0000
28@@ -1435,4 +1435,9 @@
29 }
30 }
31
32+const QNetworkConfigurationManager& Scope::networkManager() const
33+{
34+ return m_network_manager;
35+}
36+
37 } // namespace scopes_ng
38
39=== modified file 'src/Unity/scope.h'
40--- src/Unity/scope.h 2016-05-05 09:41:13 +0000
41+++ src/Unity/scope.h 2016-05-06 07:32:24 +0000
42@@ -180,6 +180,8 @@
43
44 void setSearchQueryString(const QString& search_query);
45
46+ const QNetworkConfigurationManager& networkManager() const;
47+
48 public Q_SLOTS:
49 void invalidateChildScopes();
50 void invalidateResults();

Subscribers

People subscribed via source and target branches

to all changes: