Merge lp:~aacid/unity/new_hud_client_api into lp:unity/phablet

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michael Zanetti
Approved revision: no longer in the source branch.
Merged at revision: 633
Proposed branch: lp:~aacid/unity/new_hud_client_api
Merge into: lp:unity/phablet
Prerequisite: lp:~aacid/unity/new_hud_client
Diff against target: 45 lines (+13/-0)
2 files modified
plugins/HudClient/hudclient.cpp (+12/-0)
plugins/HudClient/hudclient.h (+1/-0)
To merge this branch: bzr merge lp:~aacid/unity/new_hud_client_api
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Ted Gould (community) Approve
Review via email: mp+156616@code.launchpad.net

Commit message

Use the new API that signals models have changed

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Mark as Work In Progress until the hud-client2 package lands

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/HudClient/hudclient.cpp'
2--- plugins/HudClient/hudclient.cpp 2013-04-08 08:26:48 +0000
3+++ plugins/HudClient/hudclient.cpp 2013-04-26 08:09:29 +0000
4@@ -61,6 +61,11 @@
5 static_cast<HudClient*>(dst)->modelReallyReady(true);
6 }
7
8+static void modelsChangedCB(GObject* /*src*/, gpointer dst)
9+{
10+ static_cast<HudClient*>(dst)->queryModelsChanged();
11+}
12+
13 } // extern "C"
14
15 } // namespace
16@@ -79,6 +84,7 @@
17 g_signal_connect(G_OBJECT(m_clientQuery), "voice-query-heard-something", G_CALLBACK(heardSomethingCB), this);
18 g_signal_connect(G_OBJECT(m_clientQuery), "voice-query-finished", G_CALLBACK(finishedCB), this);
19 g_signal_connect(G_OBJECT(m_clientQuery), "voice-query-failed", G_CALLBACK(failedCB), this);
20+ g_signal_connect(G_OBJECT(m_clientQuery), HUD_CLIENT_QUERY_SIGNAL_MODELS_CHANGED, G_CALLBACK(modelsChangedCB), this);
21 }
22
23 // Terrible hack to get around GLib. GLib stores function pointers as gpointer, which violates the C and C++ spec
24@@ -301,3 +307,9 @@
25 g_variant_unref(actionTextVariant);
26 Q_EMIT showParametrizedAction(actionText, QVariant::fromValue(items));
27 }
28+
29+void HudClient::queryModelsChanged()
30+{
31+ m_results->setModel(hud_client_query_get_results_model(m_clientQuery));
32+ m_applicationsStack->setModel(hud_client_query_get_appstack_model(m_clientQuery));
33+}
34
35=== modified file 'plugins/HudClient/hudclient.h'
36--- plugins/HudClient/hudclient.h 2013-02-12 10:40:50 +0000
37+++ plugins/HudClient/hudclient.h 2013-04-26 08:09:29 +0000
38@@ -57,6 +57,7 @@
39
40 void modelReady(bool needDisconnect);
41 void modelReallyReady(bool needDisconnect);
42+ void queryModelsChanged();
43
44 Q_SIGNALS:
45 void voiceQueryLoading();

Subscribers

People subscribed via source and target branches