diff options
author | José Alburquerque <jaalburqu@svn.gnome.org> | 2010-09-02 20:13:34 -0400 |
---|---|---|
committer | José Alburquerque <jaalburqu@svn.gnome.org> | 2010-09-02 20:13:34 -0400 |
commit | cb3065eb011783e854e38dba631cca68a500610b (patch) | |
tree | 9f5336a2c21e5a50732eb7075aa0b541a9b015d2 | |
parent | 1ad299035b85458f731e28a8b7f9b1cdc0baec0e (diff) | |
download | glibmm-cb3065eb011783e854e38dba631cca68a500610b.tar.gz |
giomm: DBus: watch_name(): Add DBusConnection implementation.
* gio/src/dbuswatchname.ccg (watch_name): Add this forgotten
function implementation accepting a DBusConnection instead of a
BusType.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | gio/src/dbuswatchname.ccg | 17 |
2 files changed, 25 insertions, 0 deletions
@@ -1,5 +1,13 @@ 2010-09-02 José Alburquerque <jaalburqu@svn.gnome.org> + giomm: DBus: watch_name(): Add DBusConnection implementation. + + * gio/src/dbuswatchname.ccg (watch_name): Add this forgotten + function implementation accepting a DBusConnection instead of a + BusType. + +2010-09-02 José Alburquerque <jaalburqu@svn.gnome.org> + giomm: DBus: Add watch/unwatch_name(). * gio/src/dbuswatchname.{ccg,hg}: diff --git a/gio/src/dbuswatchname.ccg b/gio/src/dbuswatchname.ccg index 19831447..c6856987 100644 --- a/gio/src/dbuswatchname.ccg +++ b/gio/src/dbuswatchname.ccg @@ -105,6 +105,23 @@ guint watch_name(BusType bus_type, const Glib::ustring& name, slots, &Bus_Watch_Name_giomm_callback_destroy); } +guint watch_name(const Glib::RefPtr<DBusConnection>& connection, +const Glib::ustring& name, BusNameWatcherFlags flags, +const SlotNameAppeared& name_appeared_slot, + const SlotNameVanished& name_vanished_slot) +{ + struct WatchSlots* slots = new WatchSlots; + + // Make copies of the slots which will be deleted on destroy notification. + slots->name_appeared_slot = new SlotNameAppeared(name_appeared_slot); + slots->name_vanished_slot = new SlotNameVanished(name_vanished_slot); + + return g_bus_watch_name_on_connection(Glib::unwrap(connection), + name.c_str(), static_cast<GBusNameWatcherFlags>(flags), + &Bus_Name_Appeared_giomm_callback, &Bus_Name_Vanished_giomm_callback, + slots, &Bus_Watch_Name_giomm_callback_destroy); +} + void unwatch_name(guint watcher_id) { g_bus_unwatch_name(watcher_id); |