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
=== modified file 'libunity-2d-private/Unity2d/placeentry.cpp'
--- libunity-2d-private/Unity2d/placeentry.cpp 2011-06-07 16:34:46 +0000
+++ libunity-2d-private/Unity2d/placeentry.cpp 2011-06-22 13:35:15 +0000
@@ -570,7 +570,7 @@
570 if (m_dbusIface != NULL) {570 if (m_dbusIface != NULL) {
571 /* the cast to uint is necessary for the D-Bus call to succeed as the571 /* the cast to uint is necessary for the D-Bus call to succeed as the
572 interface expects that type */572 interface expects that type */
573 m_dbusIface->call("SetActiveSection", (uint)m_activeSection);573 m_dbusIface->asyncCall("SetActiveSection", (uint)m_activeSection);
574 }574 }
575 Q_EMIT activeSectionChanged();575 Q_EMIT activeSectionChanged();
576 }576 }
@@ -582,14 +582,14 @@
582 if (active != m_active) {582 if (active != m_active) {
583 m_active = active;583 m_active = active;
584 if (m_dbusIface != NULL) {584 if (m_dbusIface != NULL) {
585 m_dbusIface->call("SetActive", m_active);585 m_dbusIface->asyncCall("SetActive", m_active);
586 }586 }
587 Q_EMIT activeChanged();587 Q_EMIT activeChanged();
588588
589 if (m_dbusIface && m_active) {589 if (m_dbusIface && m_active) {
590 /* SetActiveSection needs to be called after SetActive(true)590 /* SetActiveSection needs to be called after SetActive(true)
591 in order for it to have an effect. */591 in order for it to have an effect. */
592 m_dbusIface->call("SetActiveSection", m_activeSection);592 m_dbusIface->asyncCall("SetActiveSection", m_activeSection);
593 }593 }
594 }594 }
595}595}
@@ -601,7 +601,7 @@
601 m_entrySearchQuery = entrySearchQuery;601 m_entrySearchQuery = entrySearchQuery;
602 if (m_dbusIface != NULL) {602 if (m_dbusIface != NULL) {
603 QHash<QString, QString> searchHints;603 QHash<QString, QString> searchHints;
604 m_dbusIface->call("SetSearch", m_entrySearchQuery, qVariantFromValue(searchHints));604 m_dbusIface->asyncCall("SetSearch", m_entrySearchQuery, qVariantFromValue(searchHints));
605 }605 }
606 Q_EMIT entrySearchQueryChanged();606 Q_EMIT entrySearchQueryChanged();
607 }607 }
@@ -680,7 +680,7 @@
680 m_globalSearchQuery = globalSearchQuery;680 m_globalSearchQuery = globalSearchQuery;
681 if (m_dbusIface != NULL) {681 if (m_dbusIface != NULL) {
682 QHash<QString, QString> searchHints;682 QHash<QString, QString> searchHints;
683 m_dbusIface->call("SetGlobalSearch", m_globalSearchQuery, qVariantFromValue(searchHints));683 m_dbusIface->asyncCall("SetGlobalSearch", m_globalSearchQuery, qVariantFromValue(searchHints));
684 }684 }
685 Q_EMIT globalSearchQueryChanged();685 Q_EMIT globalSearchQueryChanged();
686 }686 }
@@ -917,10 +917,10 @@
917917
918 /* Update state of D-Bus daemon according to the values of local properties */918 /* Update state of D-Bus daemon according to the values of local properties */
919 QHash<QString, QString> searchHints;919 QHash<QString, QString> searchHints;
920 m_dbusIface->call("SetSearch", m_entrySearchQuery, qVariantFromValue(searchHints));920 m_dbusIface->asyncCall("SetSearch", m_entrySearchQuery, qVariantFromValue(searchHints));
921 m_dbusIface->call("SetGlobalSearch", m_globalSearchQuery, qVariantFromValue(searchHints));921 m_dbusIface->asyncCall("SetGlobalSearch", m_globalSearchQuery, qVariantFromValue(searchHints));
922 m_dbusIface->call("SetActive", m_active);922 m_dbusIface->asyncCall("SetActive", m_active);
923 m_dbusIface->call("SetActiveSection", m_activeSection);923 m_dbusIface->asyncCall("SetActiveSection", m_activeSection);
924}924}
925925
926void926void

Subscribers

People subscribed via source and target branches