diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ephy-dbus.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/ephy-dbus.c b/lib/ephy-dbus.c index 349202ea8..b1f15a7ec 100644 --- a/lib/ephy-dbus.c +++ b/lib/ephy-dbus.c @@ -113,7 +113,11 @@ session_filter_func (DBusConnection *connection, EphyDbus *dbus = EPHY_DBUS (user_data); if (dbus_message_is_signal (message, +#ifdef HAVE_NEW_DBUS + DBUS_INTERFACE_LOCAL, +#else DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL, +#endif "Disconnected")) { LOG ("EphyDbus disconnected from session bus"); @@ -143,7 +147,11 @@ system_filter_func (DBusConnection *connection, LOG ("EphyDbus filtering message from system bus"); if (dbus_message_is_signal (message, +#ifdef HAVE_NEW_DBUS + DBUS_INTERFACE_LOCAL, +#else DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL, +#endif "Disconnected")) { LOG ("EphyDbus disconnected from system bus"); @@ -180,7 +188,12 @@ ephy_dbus_connect_to_system_bus (EphyDbus *dbus) dbus_connection_set_exit_on_disconnect (bus, FALSE); dbus_connection_setup_with_g_main (bus, NULL); +#ifdef HAVE_NEW_DBUS + dbus_bus_request_name (bus, epiphany_dbus_service, 0, &error); +#else dbus_connection_add_filter (bus, system_filter_func, dbus, NULL); +#endif + dbus_bus_add_match (bus, "type='signal',interface='org.freedesktop.NetworkManager'", &error); @@ -214,7 +227,12 @@ ephy_dbus_connect_to_session_bus (EphyDbus *dbus) dbus_connection_add_filter (bus, session_filter_func, dbus, NULL); +#ifdef HAVE_NEW_DBUS + dbus_bus_request_name (bus, epiphany_dbus_service, 0, NULL); +#else dbus_bus_acquire_service (bus, epiphany_dbus_service, 0, &error); +#endif + if (dbus_error_is_set (&error)) { g_warning ("EphyDbus failed to acquire epiphany service"); dbus_error_free (&error); |