args = dialog.values();
}
- // Special case - convert a value to a QDBusVariant if the
- // interface wants a variant
+ // Try to convert the values we got as closely as possible to the
+ // dbus signature. This is especially important for those input as strings
for (int i = 0; i < args.count(); ++i) {
+ QVariant a = args.at(i);
+ int desttype = types.at(i);
+ if (desttype < int(QMetaType::User) && desttype != int(QVariant::Map)
+ && a.canConvert(desttype)) {
+ args[i].convert(desttype);
+ }
+ // Special case - convert a value to a QDBusVariant if the
+ // interface wants a variant
if (types.at(i) == qMetaTypeId<QDBusVariant>())
args[i] = QVariant::fromValue(QDBusVariant(args.at(i)));
}