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



commit 215ab06259e5608da7ab149eadd18d725a1ce374
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 ac381ff7a..c3f729659 100644
--- a/src/addressbook/libedata-book/e-data-book.c
+++ b/src/addressbook/libedata-book/e-data-book.c
@@ -1856,6 +1856,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 a1c052bf7..80365fe8e 100644
--- a/src/calendar/libedata-cal/e-data-cal.c
+++ b/src/calendar/libedata-cal/e-data-cal.c
@@ -2470,6 +2470,12 @@ e_data_cal_report_backend_property_changed (EDataCal *cal,
        if (g_str_equal (prop_name, 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]