-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Naming conflicts with NetworkManager's PropertiesChanged signals #99
Comments
At the top of
I was considering if we want to namespace each interface, but it feels like it might be overkill for most cases. So I think the pragmatic solution is to detect the few collisions that occur and add something to the names for those cases only. |
Hey, I am in the process of writing a dart based connection to Avahi's DBus interface, and since I am not very familiar with how DBus works exactly, is it okay if I edit the generated code and rename the collisions or would something change? /// Signal data for org.freedesktop.Avahi.AddressResolver.Found.
class OrgFreedesktopDBusIntrospectableFound extends DBusSignal{
int get interface => (values[0] as DBusInt32).value;
int get protocol => (values[1] as DBusInt32).value;
int get aprotocol => (values[2] as DBusInt32).value;
String get address => (values[3] as DBusString).value;
String get name => (values[4] as DBusString).value;
int get flags => (values[5] as DBusUint32).value;
OrgFreedesktopDBusIntrospectableFound(DBusSignal signal) : super(signal.sender, signal.path, signal.interface, signal.member, signal.values);
} In this example, the interface name collides with the super class method. |
@Piero512 you can edit the generated code and change the names, this API is only used by your app, and the DBus code doesn't call them. |
This should be greatly improved in 0.1.2. |
I think I am running into this issue. I generated a dart file from the systemd1 xml interface. The generated code has an error: class OrgFreedesktopDBusPeer extends DBusRemoteObject {
/// Stream of org.freedesktop.DBus.Properties.PropertiesChanged signals.
/// ERROR: Isn't a valid override: supertype is <DBusPropertiesChangedSignal>
late final Stream<OrgFreedesktopDBusPeerPropertiesChanged> propertiesChanged;
... |
If your XML file is the same one as the one I found with an internet search it contains definitions for the standard interfaces. You should remove these, and we should probably detect this and ignore them in the generator. Please open a new issue for this if this is a problem. |
I generated the XML using the following Dart code: var client = DBusClient.system();
var sysd = DBusRemoteObject(client,
name: 'org.freedesktop.systemd1',
path: DBusObjectPath('/org/freedesktop/systemd1'));
var m = await sysd.introspect();
var f = File('systemd.xml');
f.writeAsStringSync('${m.toXml()}');
|
Note that the original issue here was different interfaces that used the same method names. The case I've opened the new issue for is standard interfaces being defined and dbus.dart generating code for them that is already provided. |
NetworkManager has some annoying deprecated
PropertiesChanged
signals, which are causing naming conflicts withDBusRemoteObject.subscribePropertiesChanged()
.For example:
=>
=>
The text was updated successfully, but these errors were encountered: