After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 623198 - DBus.Connection.get_object_for_name_owner() doesn't generate an *_iface_dbus_proxy_new() method
DBus.Connection.get_object_for_name_owner() doesn't generate an *_iface_dbus_...
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: D-Bus
0.9.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-30 10:15 UTC by Philip Withnall
Modified: 2011-01-15 13:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philip Withnall 2010-06-30 10:15:21 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.
Comment 1 Jürg Billeter 2010-10-20 18:50:37 UTC
Please note that dbus-glib support has been deprecated in the meantime. You should consider moving to GDBus.
Comment 2 Jürg Billeter 2011-01-15 13:23:41 UTC
There are no plans to improve the deprecated dbus-glib support. If you have issues with GDBus support, please let us know.