Thread: [SailfishOS+Harmattan] QDBusConnection: receive/send message
View Single Post
marxian's Avatar
Posts: 2,448 | Thanked: 9,523 times | Joined on Aug 2010 @ Wigan, UK
#5
It could be that the QDBusArgument::currentType() of the map values is not handled in dbusArgumentToVariant(), therfore an null QVariant is returned. Try adding a qDebug() statement in that function to check the reported type:

Code:
QVariant dbusArgumentToVariant(const QDBusArgument &arg) {
    qDebug() << "dbusArgumentToVariant. Current type is" << arg.currentType();
    switch (arg.currentType()) {
    case QDBusArgument::BasicType:
    case QDBusArgument::VariantType:
        return basicTypeToVariant(arg);
    case QDBusArgument::ArrayType:
        return arrayTypeToVariant(arg);
    case QDBusArgument::MapType:
        return mapTypeToVariant(arg);
    default:
        qDebug() << "dbusArgumentToVariant. Type not handled.";
        return QVariant();
    }
}
I would expect the map values to be basic/variant type, so perhaps QDBusArgument::asVariant() is returning a null QVariant.
__________________
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith

My website

GitHub
 

The Following User Says Thank You to marxian For This Useful Post: