Pelagicore / gdbus-codegen-glibmm

Code generator for C++ D-Bus stubs and proxies using Giomm/Glibmm
GNU Lesser General Public License v2.1
23 stars 25 forks source link

Invalid results for parameterless signals with no return type #89

Open zygny opened 5 years ago

zygny commented 5 years ago

Starting out on my journey with DBus bindings so forgive me if I am doing something wrong/silly here...

Starting at the start: My goal is to generate a proxy object for Network Manager.

I can generate NetworkManager introspection XML with: gdbus introspect --system --dest=org.freedesktop.NetworkManager --object-path=/org/freedesktop/NetworkManager --xml > generated/network_manager_introspect.xml

Then feed the XML into codegen: gdbus-codegen-glibmm3 --generate-cpp-code=generated/network-manager generated/network_manager_introspect.xml --interface-prefix="org.freedesktop"

Firstly, this reproduces #77 as the sub-nodes are not populated in generated/network_manager_introspect.xml (stripping unnecessary detail):


...snip...

<node>
  <interface name="org.freedesktop.NetworkManager">

...snip...

  </interface>
  <node name="DnsManager"/>
  <node name="DHCP4Config"/>
  <node name="ActiveConnection"/>
  <node name="Devices"/>
  <node name="AgentManager"/>
  <node name="Settings"/>
  <node name="IP6Config"/>
  <node name="IP4Config"/>
</node>

Secondly, after deleting the sub-nodes, I tried feeding the modified XML into codegen again, it successfully generates the expected [cpp|h] files. The 'CheckPermissions' signal: docs that has no parameters and no return values is incorrectly generated in generated/network-manager_proxy.h:

class NetworkManager : public Glib::ObjectBase {
public:

...snip...

    sigc::signal<void,  > CheckPermissions_signal;

...snip...
mardy commented 5 years ago

@zygny Thanks for your bug report, it looks like we indeed never found a signal with no parameters. But the use-case is valid, so this muxt be fixed.