Merge lp:~fboucault/unity-2d/place_calls_async into lp:unity-2d/3.0

Proposed by Florian Boucault
Status: Merged
Approved by: Ugo Riboni
Approved revision: 612
Merged at revision: 612
Proposed branch: lp:~fboucault/unity-2d/place_calls_async
Merge into: lp:unity-2d/3.0
Diff against target: 62 lines (+9/-9)
1 file modified
libunity-2d-private/Unity2d/placeentry.cpp (+9/-9)
To merge this branch: bzr merge lp:~fboucault/unity-2d/place_calls_async
Reviewer Review Type Date Requested Status
Ugo Riboni (community) Approve
Review via email: mp+65498@code.launchpad.net

Description of the change

[dash] Make all D-Bus calls to the place daemons asynchronous as to not freeze the user interface while searches or activations are in progress.

To post a comment you must log in.
Revision history for this message
Florian Boucault (fboucault) wrote :

Reproducing one of the issue is easy by using a lens that queries Internet sources such as the Unity Books Lens (https://launchpad.net/unity-books-lens).
Both the global search and the place specific search were affected.
Also activating a lens from the launcher was problematic leading to the dash not showing up before the lens daemon had responded.

Revision history for this message
Florian Boucault (fboucault) wrote :

I verified that Unity does the same: calls the D-Bus methods asynchronously without attaching a callback to receive any answer.

Revision history for this message
Ugo Riboni (uriboni) wrote :

Assuming you didn't forget to change any call to async, it looks good to me.
I tested it and functionally it fixes the issue (with the book lens and global search)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libunity-2d-private/Unity2d/placeentry.cpp'
2--- libunity-2d-private/Unity2d/placeentry.cpp 2011-06-07 16:34:46 +0000
3+++ libunity-2d-private/Unity2d/placeentry.cpp 2011-06-22 13:35:15 +0000
4@@ -570,7 +570,7 @@
5 if (m_dbusIface != NULL) {
6 /* the cast to uint is necessary for the D-Bus call to succeed as the
7 interface expects that type */
8- m_dbusIface->call("SetActiveSection", (uint)m_activeSection);
9+ m_dbusIface->asyncCall("SetActiveSection", (uint)m_activeSection);
10 }
11 Q_EMIT activeSectionChanged();
12 }
13@@ -582,14 +582,14 @@
14 if (active != m_active) {
15 m_active = active;
16 if (m_dbusIface != NULL) {
17- m_dbusIface->call("SetActive", m_active);
18+ m_dbusIface->asyncCall("SetActive", m_active);
19 }
20 Q_EMIT activeChanged();
21
22 if (m_dbusIface && m_active) {
23 /* SetActiveSection needs to be called after SetActive(true)
24 in order for it to have an effect. */
25- m_dbusIface->call("SetActiveSection", m_activeSection);
26+ m_dbusIface->asyncCall("SetActiveSection", m_activeSection);
27 }
28 }
29 }
30@@ -601,7 +601,7 @@
31 m_entrySearchQuery = entrySearchQuery;
32 if (m_dbusIface != NULL) {
33 QHash<QString, QString> searchHints;
34- m_dbusIface->call("SetSearch", m_entrySearchQuery, qVariantFromValue(searchHints));
35+ m_dbusIface->asyncCall("SetSearch", m_entrySearchQuery, qVariantFromValue(searchHints));
36 }
37 Q_EMIT entrySearchQueryChanged();
38 }
39@@ -680,7 +680,7 @@
40 m_globalSearchQuery = globalSearchQuery;
41 if (m_dbusIface != NULL) {
42 QHash<QString, QString> searchHints;
43- m_dbusIface->call("SetGlobalSearch", m_globalSearchQuery, qVariantFromValue(searchHints));
44+ m_dbusIface->asyncCall("SetGlobalSearch", m_globalSearchQuery, qVariantFromValue(searchHints));
45 }
46 Q_EMIT globalSearchQueryChanged();
47 }
48@@ -917,10 +917,10 @@
49
50 /* Update state of D-Bus daemon according to the values of local properties */
51 QHash<QString, QString> searchHints;
52- m_dbusIface->call("SetSearch", m_entrySearchQuery, qVariantFromValue(searchHints));
53- m_dbusIface->call("SetGlobalSearch", m_globalSearchQuery, qVariantFromValue(searchHints));
54- m_dbusIface->call("SetActive", m_active);
55- m_dbusIface->call("SetActiveSection", m_activeSection);
56+ m_dbusIface->asyncCall("SetSearch", m_entrySearchQuery, qVariantFromValue(searchHints));
57+ m_dbusIface->asyncCall("SetGlobalSearch", m_globalSearchQuery, qVariantFromValue(searchHints));
58+ m_dbusIface->asyncCall("SetActive", m_active);
59+ m_dbusIface->asyncCall("SetActiveSection", m_activeSection);
60 }
61
62 void

Subscribers

People subscribed via source and target branches