[evolution-data-server] EDataBook/EDataCal: Flush GDBus connection on backend property change



commit 760002735da1a0d1c1851d0b56c3031130739480
Author: Milan Crha <mcrha redhat com>
Date:   Thu May 23 20:52:50 2019 +0200

    EDataBook/EDataCal: Flush GDBus connection on backend property change
    
    This should make sure the client side will receive property changes
    as soon as possible.

 src/addressbook/libedata-book/e-data-book.c | 6 ++++++
 src/calendar/libedata-cal/e-data-cal.c      | 6 ++++++
 2 files changed, 12 insertions(+)
---
diff --git a/src/addressbook/libedata-book/e-data-book.c b/src/addressbook/libedata-book/e-data-book.c
index 837e48c70..b7287aff0 100644
--- a/src/addressbook/libedata-book/e-data-book.c
+++ b/src/addressbook/libedata-book/e-data-book.c
@@ -1570,6 +1570,12 @@ e_data_book_report_backend_property_changed (EDataBook *book,
                g_strfreev (strv);
        }
 
+       /* Ensure the property change signal on the D-Bus is invoked immediately, not on idle */
+       g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (dbus_interface));
+
+       if (book->priv->connection && !g_dbus_connection_is_closed (book->priv->connection))
+               g_dbus_connection_flush_sync (book->priv->connection, NULL, NULL);
+
        /* Disregard anything else. */
 }
 
diff --git a/src/calendar/libedata-cal/e-data-cal.c b/src/calendar/libedata-cal/e-data-cal.c
index 8be747e4a..2459bb66c 100644
--- a/src/calendar/libedata-cal/e-data-cal.c
+++ b/src/calendar/libedata-cal/e-data-cal.c
@@ -2180,6 +2180,12 @@ e_data_cal_report_backend_property_changed (EDataCal *cal,
        if (g_str_equal (prop_name, E_CAL_BACKEND_PROPERTY_DEFAULT_OBJECT))
                e_dbus_calendar_set_default_object (dbus_interface, prop_value);
 
+       /* Ensure the property change signal on the D-Bus is invoked immediately, not on idle */
+       g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (dbus_interface));
+
+       if (cal->priv->connection && !g_dbus_connection_is_closed (cal->priv->connection))
+               g_dbus_connection_flush_sync (cal->priv->connection, NULL, NULL);
+
        /* Disregard anything else. */
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]