diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-07-22 15:30:01 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-07-22 15:30:01 (GMT) |
commit | 7a208874ae5d69d2b70b08f03675ef8f0c843a7f (patch) | |
tree | 74af8f29a352825a98147c7a6336d397ebd0517d /src | |
parent | 9e5fa633913ef952ca4ef5312fe396bcfc885321 (diff) | |
download | Qt-7a208874ae5d69d2b70b08f03675ef8f0c843a7f.zip Qt-7a208874ae5d69d2b70b08f03675ef8f0c843a7f.tar.gz Qt-7a208874ae5d69d2b70b08f03675ef8f0c843a7f.tar.bz2 |
Fix handling of invalid object paths and signatures in release mode.
I had this #ifdef __OPTIMIZE__ there so that the compiler would know
not to generate unnecessary calls and a long jump table for the switch
of the marshalling code.
Turns out that in release mode, the checks I added to make sure we
detect invalid object paths and signatures were never hit (we always
treated them as pure strings).
So use the signature- and object path-checking code in both release
and debug mode.
Task-number: reported via email (tst_qdbusmarshall failing)
Reviewed-by: Peter Hartmann
Diffstat (limited to 'src')
-rw-r--r-- | src/dbus/qdbusmarshaller.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/dbus/qdbusmarshaller.cpp b/src/dbus/qdbusmarshaller.cpp index 7ada1ed..646f68a 100644 --- a/src/dbus/qdbusmarshaller.cpp +++ b/src/dbus/qdbusmarshaller.cpp @@ -388,16 +388,6 @@ bool QDBusMarshaller::appendVariantInternal(const QVariant &arg) case DBUS_TYPE_DOUBLE: qIterAppend(&iterator, ba, *signature, arg.constData()); return true; - - case DBUS_TYPE_STRING: - case DBUS_TYPE_OBJECT_PATH: - case DBUS_TYPE_SIGNATURE: { - const QByteArray data = - reinterpret_cast<const QString *>(arg.constData())->toUtf8(); - const char *rawData = data.constData(); - qIterAppend(&iterator, ba, *signature, &rawData); - return true; - } #else case DBUS_TYPE_BYTE: append( qvariant_cast<uchar>(arg) ); @@ -426,6 +416,8 @@ bool QDBusMarshaller::appendVariantInternal(const QVariant &arg) case DBUS_TYPE_DOUBLE: append( arg.toDouble() ); return true; +#endif + case DBUS_TYPE_STRING: append( arg.toString() ); return true; @@ -435,7 +427,6 @@ bool QDBusMarshaller::appendVariantInternal(const QVariant &arg) case DBUS_TYPE_SIGNATURE: append( qvariant_cast<QDBusSignature>(arg) ); return true; -#endif // compound types: case DBUS_TYPE_VARIANT: |