diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-05-28 21:46:28 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-05-28 21:46:28 +0800 |
commit | a29f71709ee09ddce6da8ddd80c45b5311dd38b2 (patch) | |
tree | 5e137d0c03db4e92744f6f171b3f0f7261f47336 /lib | |
parent | 72e83ac58129afa3706116830711d2a072f030c9 (diff) | |
download | gsoc2013-epiphany-a29f71709ee09ddce6da8ddd80c45b5311dd38b2.tar gsoc2013-epiphany-a29f71709ee09ddce6da8ddd80c45b5311dd38b2.tar.gz gsoc2013-epiphany-a29f71709ee09ddce6da8ddd80c45b5311dd38b2.tar.bz2 gsoc2013-epiphany-a29f71709ee09ddce6da8ddd80c45b5311dd38b2.tar.lz gsoc2013-epiphany-a29f71709ee09ddce6da8ddd80c45b5311dd38b2.tar.xz gsoc2013-epiphany-a29f71709ee09ddce6da8ddd80c45b5311dd38b2.tar.zst gsoc2013-epiphany-a29f71709ee09ddce6da8ddd80c45b5311dd38b2.zip |
Check for new DBUS API.
2005-05-28 Christian Persch <chpe@cvs.gnome.org>
* configure.ac:
Check for new DBUS API.
* lib/ephy-dbus.c: (session_filter_func), (system_filter_func),
(ephy_dbus_connect_to_system_bus),
(ephy_dbus_connect_to_session_bus):
Adapt to new DBUS API. Patch by Thom May, fixes bug #301153.
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); |