Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-18419

qdbusxml2cpp skips the first 'out' argument in a method call

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 4.7.2
    • D-Bus
    • None
    • Ubuntu 10.10

    Description

      The following xml:

      <method name="GetCurrentHardwareState">
      <!-- see signal definition for description of each parameter -->
      <arg type="b" name="button_pressed" direction="out"/>
      <arg type="b" name="button_pressed" direction="out"/>
      <arg type="b" name="button_transition_lost" direction="out"/>
      <arg type="b" name="charge_state_usb" direction="out"/>
      <arg type="b" name="charge_state_ac" direction="out"/>
      <arg type="q" name="charge_state_level" direction="out"/>
      <arg type="n" name="current_temperature" direction="out"/>
      <arg type="q" name="battery_level" direction="out"/>
      <arg type="q" name="sd_slot_state" direction="out"/>
      </method>

      generates the following cpp:

         inline QDBusReply<bool> GetCurrentHardwareState(bool &button_transition_lost, bool &charge_state_usb, bool &charge_state_ac, ushort &charge_state_level, short &current_temperature, ushort &battery_level, ushort &sd_slot_state)
          {
              QList<QVariant> argumentList;
              QDBusMessage reply = callWithArgumentList(QDBus::Block, QLatin1String("GetCurrentHardwareState"), argumentList);
              if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 8) {
                  button_transition_lost = qdbus_cast<bool>(reply.arguments().at(1));
                  charge_state_usb = qdbus_cast<bool>(reply.arguments().at(2));
                  charge_state_ac = qdbus_cast<bool>(reply.arguments().at(3));
                  charge_state_level = qdbus_cast<ushort>(reply.arguments().at(4));
                  current_temperature = qdbus_cast<short>(reply.arguments().at(5));
                  battery_level = qdbus_cast<ushort>(reply.arguments().at(6));
                  sd_slot_state = qdbus_cast<ushort>(reply.arguments().at(7));
              }
              return reply;
          }
      

      Note that the argument count is correct but that the first argument, button_pressed, is left out of the method signature and the assignment list. Correcting the code by hand works.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            gharley Greg Harley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes