Merge lp:~mhr3/unity-scopes-shell/fix-1314702 into lp:unity-scopes-shell

Proposed by Michal Hruby
Status: Merged
Merged at revision: 90
Proposed branch: lp:~mhr3/unity-scopes-shell/fix-1314702
Merge into: lp:unity-scopes-shell
Diff against target: 69 lines (+8/-5)
2 files modified
src/Unity/previewstack.cpp (+5/-3)
src/Unity/scope.cpp (+3/-2)
To merge this branch: bzr merge lp:~mhr3/unity-scopes-shell/fix-1314702
Reviewer Review Type Date Requested Status
Pete Woods (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+217795@code.launchpad.net

Commit message

Pass correct locale and form factor to scopes.

Description of the change

Pass correct locale and form factor to scopes.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Pete Woods (pete-woods) wrote :

Looks good to me

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Unity/previewstack.cpp'
2--- src/Unity/previewstack.cpp 2014-03-25 16:34:26 +0000
3+++ src/Unity/previewstack.cpp 2014-04-30 17:16:21 +0000
4@@ -27,6 +27,7 @@
5 #include "utils.h"
6
7 // Qt
8+#include <QLocale>
9 #include <QJsonDocument>
10 #include <QJsonObject>
11 #include <QJsonValue>
12@@ -120,7 +121,8 @@
13 try {
14 auto proxy = m_previewedResult->target_scope_proxy();
15
16- scopes::ActionMetadata metadata("C", "phone"); //FIXME
17+ QString formFactor(m_associatedScope ? m_associatedScope->formFactor() : "phone");
18+ scopes::ActionMetadata metadata(QLocale::system().name().toStdString(), formFactor.toStdString());
19 if (!extra_data.is_null()) {
20 metadata.set_scope_data(extra_data);
21 }
22@@ -132,7 +134,6 @@
23 if (prev_listener) prev_listener->invalidate();
24 m_listeners[m_activePreview] = wl;
25
26- // FIXME: don't block
27 m_lastPreviewQuery = proxy->preview(*(m_previewedResult.get()), metadata, listener);
28 } catch (std::exception& e) {
29 qWarning("Caught an error from preview(): %s", e.what());
30@@ -160,7 +161,8 @@
31
32 try {
33 auto proxy = m_previewedResult->target_scope_proxy();
34- scopes::ActionMetadata metadata("C", "phone"); //FIXME
35+ QString formFactor(m_associatedScope ? m_associatedScope->formFactor() : "phone");
36+ scopes::ActionMetadata metadata(QLocale::system().name().toStdString(), formFactor.toStdString());
37 metadata.set_scope_data(qVariantToScopeVariant(data));
38
39 if (m_lastActivation) {
40
41=== modified file 'src/Unity/scope.cpp'
42--- src/Unity/scope.cpp 2014-04-08 10:06:42 +0000
43+++ src/Unity/scope.cpp 2014-04-30 17:16:21 +0000
44@@ -41,6 +41,7 @@
45 #include <QScopedPointer>
46 #include <QFileInfo>
47 #include <QDir>
48+#include <QLocale>
49
50 #include <libintl.h>
51
52@@ -326,7 +327,7 @@
53 }
54
55 if (m_proxy) {
56- scopes::SearchMetadata meta("C", m_formFactor.toStdString()); //FIXME
57+ scopes::SearchMetadata meta(QLocale::system().name().toStdString(), m_formFactor.toStdString());
58 if (m_settings) {
59 QVariant remoteSearch(m_settings->get("remote-content-search"));
60 if (remoteSearch.toString() == QString("none")) {
61@@ -510,7 +511,7 @@
62 try {
63 auto proxy = result->target_scope_proxy();
64 // FIXME: don't block
65- unity::scopes::ActionMetadata metadata("C", m_formFactor.toStdString()); //FIXME
66+ unity::scopes::ActionMetadata metadata(QLocale::system().name().toStdString(), m_formFactor.toStdString());
67 m_lastActivation.reset(new ActivationReceiver(this, result));
68 proxy->activate(*(result.get()), metadata, m_lastActivation);
69 } catch (std::exception& e) {

Subscribers

People subscribed via source and target branches

to all changes: