diff options
Diffstat (limited to 'src/dbus/qdbusdemarshaller.cpp')
-rw-r--r-- | src/dbus/qdbusdemarshaller.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/dbus/qdbusdemarshaller.cpp b/src/dbus/qdbusdemarshaller.cpp index 8769846..be19b00 100644 --- a/src/dbus/qdbusdemarshaller.cpp +++ b/src/dbus/qdbusdemarshaller.cpp @@ -274,7 +274,7 @@ QVariant QDBusDemarshaller::toVariantInternal() // QByteArray return toByteArray(); case DBUS_TYPE_STRING: - return toStringList(); + return toStringListUnchecked(); case DBUS_TYPE_DICT_ENTRY: return QVariant::fromValue(duplicate()); @@ -317,7 +317,7 @@ bool QDBusDemarshaller::isCurrentTypeStringLike() } } -QStringList QDBusDemarshaller::toStringList() +QStringList QDBusDemarshaller::toStringListUnchecked() { QStringList list; @@ -330,6 +330,15 @@ QStringList QDBusDemarshaller::toStringList() return list; } +QStringList QDBusDemarshaller::toStringList() +{ + if (q_dbus_message_iter_get_arg_type(&iterator) == DBUS_TYPE_ARRAY + && q_dbus_message_iter_get_element_type(&iterator) == DBUS_TYPE_STRING) + return toStringListUnchecked(); + else + return QStringList(); +} + QByteArray QDBusDemarshaller::toByteArray() { DBusMessageIter sub; |