Skip to content

Add variant type to dbus-send

Frederik Van Bogaert requested to merge dev_add_variant_type_to_dbus_send into master

Properly add support for the variant type to dbus_send

Should work in 3 use cases:

  • A single variant argument is provided on the command line
  • Arrays of variants
  • Dictionaries with variants as keys

Manually tested and confirmed working using dbus-monitor. Example usage:

frederik@fredevuan-pc:~/dbus$ bin/dbus-send --print-reply --dest=org.lxqt.QTerminal-2725 /windows/c8ca6b18ad8744a7b9f9024dcfa4250e org.lxqt.QTerminal.Window.newTab 'dict:string:variant:test,int16:-1,world,string:solongandthanksforallthefish'
method return time=1618758023.525839 sender=:1.33 -> destination=:1.152 serial=109 reply_serial=2
   object path "/tabs/cfa2a6afe11f48f1bf02bb76f33b9b97"

In dbus-monitor:

method call time=1618758023.510109 sender=:1.152 -> destination=org.lxqt.QTerminal-2725 serial=2 path=/windows/c8ca6b18ad8744a7b9f9024dcfa4250e; interface=org.lxqt.QTerminal.Window; member=newTab
   array [
      dict entry(
         string "test"
         variant             int16 -1
      )
      dict entry(
         string "world"
         variant             string "solongandthanksforallthefish"
      )
   ]
method return time=1618758023.525697 sender=:1.33 -> destination=:1.152 serial=109 reply_serial=2
   object path "/tabs/cfa2a6afe11f48f1bf02bb76f33b9b97"

Signed-off-by: Frederik Van Bogaert frederik.vanbogaert@mind.be

Merge request reports

Loading