Details
-
Bug
-
Resolution: Incomplete
-
P2: Important
-
None
-
4.6.3, 4.7.1
-
None
-
Linux (Fedora 13, Ubuntu 8.04 & 10.10), GNOME
Description
qdbusviewer fails to properly call org.gnome.Rhythmbox.setElapsed
How Reproducible:
Every Time.
Steps to Reproduce:
1) Start Rhythmbox. Play a long song.
2) Start qdbusviewer
3) Start dbus-monitor --session
4) Using qdbusviewer Invoke org.gnome.Rhythmbox.setElapsed with 10 as the first and only argument. The 10 represents 10 seconds.
Expected Result:
Song skips to 10 second mark and continues playing.
Actual Result:
No error indication from qdbusviewer (cough, cough).
dbus-monitor reports:
method call sender=:1.110 -> dest=org.gnome.Rhythmbox serial=84 path=/org/gnome/Rhythmbox/Player; interface=org.gnome.Rhythmbox.Player; member=setElapsed
int32 10
error sender=:1.102 -> dest=:1.110 error_name=org.freedesktop.DBus.Error.UnknownMethod reply_serial=84
string "Method "setElapsed" with signature "i" on interface "org.gnome.Rhythmbox.Player" doesn't exist
Additional info:
This method can be invoked using d-feet and it works as expected.
The error was reported earlier as QTBUG-2160 and QTBUG-14664.
This time around, I am attaching dbus-monitor output listings that prove that while the client app
describes the method as having a single unsigned argument, d-feet sets up the call correctly and qdbusviewer sets up the call with a single signed integer. When the error message comes back, qdbusviewer does not report it.
The error is in the callMethod routine of "qdbusviewer.cpp".
The code relies on the types of the argument values returned from
the user input dialog box as a list of QVariants to build the DBUS message. For reasons unknown, the returned QVariant is of the type "int" rather than "uint".
The following code corrects the error:
// Special case - convert a value to a QDBusVariant if the // interface wants a variant for (int i = 0; i < args.count(); ++i) { if (types.at(i) == qMetaTypeId<QDBusVariant>()) args[i] = qVariantFromValue(QDBusVariant(args.at(i))); // Insure uint is used if uint is required. //<<<< if (types.at(i) == QMetaType::type("uint")) //<<<< args[i] = QVariant((uint) args.at(i).toUInt(0)); //<<<< }
The new code is marked with "//<<<<". The rest is to establish context.