summaryrefslogtreecommitdiffstats
path: root/src/dbus
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2011-02-10 12:26:56 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2011-02-17 15:02:14 (GMT)
commitcc2db7a49c9208a00a913f7c4a410009814a5580 (patch)
tree9f469afbdfd100d304eb4b943c3df67e15822f08 /src/dbus
parent5b53b44a2be8478adeee4a9e4796345828ad0248 (diff)
downloadQt-cc2db7a49c9208a00a913f7c4a410009814a5580.zip
Qt-cc2db7a49c9208a00a913f7c4a410009814a5580.tar.gz
Qt-cc2db7a49c9208a00a913f7c4a410009814a5580.tar.bz2
QtDBus meta object: keep methods, signals and props with unknown types
Use VoidStar as the metatype, with an unknown type called "QDBusRawType". The actual D-Bus type is saved as an hex value as a template parameter. D-Bus type Qt type comment h QDBusRawType<0x68>* Unix file descriptors ~ QDBusRawType<0x7e>* invalid type ai QDBusRawType<0x6169>* array of int32 a{i(ssy)} QDBusRawType<0x617b6928737379297d>* Note that the number in the template doesn't have to be valid. The QDBusRawType class doesn't exist anyway. I thought of just leaving the raw D-Bus type there, but who knows what kind of things can appear there, like other '>' (which may cause problems for anything trying to parse the meta object later). Task-number: QTBUG-17476
Diffstat (limited to 'src/dbus')
-rw-r--r--src/dbus/qdbusmetaobject.cpp21
-rw-r--r--src/dbus/qdbusxmlparser.cpp1
2 files changed, 13 insertions, 9 deletions
diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp
index 6683505..df8bc1d 100644
--- a/src/dbus/qdbusmetaobject.cpp
+++ b/src/dbus/qdbusmetaobject.cpp
@@ -193,14 +193,19 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature,
QByteArray typeName = annotations.value(annotationName).toLatin1();
// verify that it's a valid one
- if (typeName.isEmpty())
- return result; // invalid
-
- type = QVariant::nameToType(typeName);
- if (type == QVariant::UserType)
- type = QMetaType::type(typeName);
- if (type == QVariant::Invalid || signature != QDBusMetaType::typeToSignature(type))
- return result; // unknown type is invalid too
+ if (!typeName.isEmpty()) {
+ // type name found
+ type = QVariant::nameToType(typeName);
+ if (type == QVariant::UserType)
+ type = QMetaType::type(typeName);
+ }
+
+ if (type == QVariant::Invalid || signature != QDBusMetaType::typeToSignature(type)) {
+ // type is still unknown or doesn't match back to the signature that it
+ // was expected to, so synthesize a fake type
+ type = QMetaType::VoidStar;
+ typeName = "QDBusRawType<0x" + signature.toHex() + ">*";
+ }
result.name = typeName;
} else if (type == QVariant::Invalid) {
diff --git a/src/dbus/qdbusxmlparser.cpp b/src/dbus/qdbusxmlparser.cpp
index 413ebbe..3feedde 100644
--- a/src/dbus/qdbusxmlparser.cpp
+++ b/src/dbus/qdbusxmlparser.cpp
@@ -240,7 +240,6 @@ QDBusXmlParser::interfaces() const
qDBusParserError("Invalid D-BUS type signature '%s' found in property '%s.%s' while parsing introspection",
qPrintable(propertyData.type), qPrintable(ifaceName),
qPrintable(propertyName));
- continue;
}
QString access = property.attribute(QLatin1String("access"));