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 653256 - Use PropertiesChanged in org.freedesktop.DBus.Properties instead of custom one
Use PropertiesChanged in org.freedesktop.DBus.Properties instead of custom one
Status: RESOLVED DUPLICATE of bug 622927
Product: NetworkManager
Classification: Platform
Component: general
git master
Other All
: Normal minor
: ---
Assigned To: Pavel Simerda
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-06-23 17:20 UTC by Claudio Saavedra
Modified: 2014-01-02 21:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Claudio Saavedra 2011-06-23 17:20:49 UTC
org.freedesktop.NetworkManager is duplicating PropertiesChanged; which now exists in freedesktop.DBus.Properties. This makes stuff like gdbus-codegen generated proxies not to be able to follow properties changes here.

I suspect that there are other objects in NM dbus interface that do this. It would be great if this could be fixed for a new version of the interface.
Comment 1 Pavel Simerda 2012-07-26 12:14:44 UTC
Hi Claudio,

I've been thinking about sensible D-Bus APIs for long time and i reached the very same conclusion. D-Bus services should always avoid multiple same-name methods
on an object (only differing in interface).

D-Bus is said to map well into object-oriented languages but this is only for D-Bus APIs that follow certain recommendations.

I'm going to start a document about it:

https://fedoraproject.org/wiki/User:Pavlix/D-Bus
Comment 2 Dan Williams 2013-07-11 14:52:30 UTC
So I started to do this long, long ago.  There's one big problem though: dbus-glib doesn't allow multiple signals with different signatures on different GInterfaces.

NetworkManager already has interface-specific signals named PropertiesChanged, like org.freedesktop.NetworkManager.Device.PropertyChanged.  To implement the DBus PC signals, we'd need to define an org.freedesktop.DBus interface with a signal also named PropertiesChanged.  That means two signals on the same GObject named PropertiesChanged, with different arguments, and that's just not supported.

What we'd need to do is something like "shadow signals" or signal aliases in dbus-glib, which I did a couple years back for properties, see dbus_g_object_type_register_shadow_property().  Basically, just name the signal something different and tell dbus-glib to emit the signal as "PropertiesChanged".  This requires patches to dbus-glib though, if somebody wants to do patches for that, great.

My suggestion though would be to just do this when we convert NM internally to GDBus.
Comment 3 Dan Williams 2013-07-11 14:54:06 UTC
(In reply to comment #2)
> So I started to do this long, long ago.  There's one big problem though:
> dbus-glib doesn't allow multiple signals with different signatures on different
> GInterfaces.

To clarify, *on the same object*.  So the same object cannot implement both Interface1 with signal "Foo(s)" and Interface2 with signal "Foo(b)", for example.
Comment 4 Dan Winship 2014-01-02 21:19:35 UTC
This is basically CANTFIX for the current API. And when we port to GDBus it will be fixed automatically.

*** This bug has been marked as a duplicate of bug 622927 ***