GNOME Bugzilla – Bug 623198
DBus.Connection.get_object_for_name_owner() doesn't generate an *_iface_dbus_proxy_new() method
Last modified: 2011-01-15 13:23:41 UTC
With a D-Bus interface declared as follows: [DBus (name = "org.freedesktop.Telepathy.Logger.DRAFT")] private interface LoggerIface : DBus.Object { public abstract async AccountFavourites[] get_favourite_contacts () throws DBus.Error; public abstract async void add_favourite_contact ( DBus.ObjectPath account_path, string id) throws DBus.Error; public abstract async void remove_favourite_contact ( DBus.ObjectPath account_path, string id) throws DBus.Error; public abstract signal void favourite_contacts_changed ( DBus.ObjectPath account_path, string[] added, string[] removed); } creating a proxy object for it works fine with the following code: var dbus_conn = DBus.Bus.get (DBus.BusType.SESSION); this.logger = dbus_conn.get_object ( "org.freedesktop.Telepathy.Logger", "/org/freedesktop/Telepathy/Logger", "org.freedesktop.Telepathy.Logger.DRAFT") as LoggerIface; but if the dbus_conn.get_object() call is replaced with dbus_conn.get_object_for_name_owner() (with the same parameters), valac tries to create the proxy object using dbus_g_proxy_new_for_name_owner() directly, rather than using the following proxy creation function: LoggerIface* logger_iface_dbus_proxy_new (DBusGConnection* connection, const char* name, const char* path) { LoggerIface* self; self = g_object_new (logger_iface_dbus_proxy_get_type (), "connection", connection, "name", name, "path", path, "interface", "org.freedesktop.Telepathy.Logger.DRAFT", NULL); return self; } This function was generated and used with the dbus_conn.get_object() call.
Please note that dbus-glib support has been deprecated in the meantime. You should consider moving to GDBus.
There are no plans to improve the deprecated dbus-glib support. If you have issues with GDBus support, please let us know.