diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp index b81d8a68f6..85d7d016ff 100644 --- a/src/dbus/qdbuserror.cpp +++ b/src/dbus/qdbuserror.cpp @@ -250,6 +250,16 @@ static inline QDBusError::ErrorType get(const char *name) \value InvalidInterface The interface is invalid. */ +/*! + \internal + Constructs a QDBusError that represents no error. +*/ +QDBusError::QDBusError() + : code(NoError) +{ + +} + #ifndef QT_BOOTSTRAPPED /*! \internal diff --git a/src/dbus/qdbuserror.h b/src/dbus/qdbuserror.h index a6b3c9a70a..52e65d677d 100644 --- a/src/dbus/qdbuserror.h +++ b/src/dbus/qdbuserror.h @@ -95,8 +95,9 @@ public: #endif }; + QDBusError(); #ifndef QT_BOOTSTRAPPED - explicit QDBusError(const DBusError *error = 0); + explicit QDBusError(const DBusError *error); /*implicit*/ QDBusError(const QDBusMessage& msg); #endif QDBusError(ErrorType error, const QString &message); @@ -126,6 +127,8 @@ Q_DBUS_EXPORT QDebug operator<<(QDebug, const QDBusError &); QT_END_NAMESPACE +Q_DECLARE_METATYPE(QDBusError) + QT_END_HEADER #endif // QT_NO_DBUS diff --git a/src/dbus/qdbusmessage.h b/src/dbus/qdbusmessage.h index 20859ebb70..461a27600e 100644 --- a/src/dbus/qdbusmessage.h +++ b/src/dbus/qdbusmessage.h @@ -124,6 +124,8 @@ Q_DBUS_EXPORT QDebug operator<<(QDebug, const QDBusMessage &); QT_END_NAMESPACE +Q_DECLARE_METATYPE(QDBusMessage) + QT_END_HEADER #endif // QT_NO_DBUS diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp index 5c8a7bc08f..835fa4fa43 100644 --- a/src/dbus/qdbusmetatype.cpp +++ b/src/dbus/qdbusmetatype.cpp @@ -105,15 +105,15 @@ void QDBusMetaTypeId::init() // set the guard variable at the end if (!initialized) { #ifndef QT_BOOTSTRAPPED - // register our types with QtCore - message = qRegisterMetaType("QDBusMessage"); - error = qRegisterMetaType("QDBusError"); + // register our types with QtCore (calling qMetaTypeId() does this implicitly) + message = qMetaTypeId(); + error = qMetaTypeId(); #endif - argument = qRegisterMetaType("QDBusArgument"); - variant = qRegisterMetaType("QDBusVariant"); - objectpath = qRegisterMetaType("QDBusObjectPath"); - signature = qRegisterMetaType("QDBusSignature"); - unixfd = qRegisterMetaType("QDBusUnixFileDescriptor"); + argument = qMetaTypeId(); + variant = qMetaTypeId(); + objectpath = qMetaTypeId(); + signature = qMetaTypeId(); + unixfd = qMetaTypeId(); #ifndef QDBUS_NO_SPECIALTYPES // and register QtCore's with us diff --git a/src/dbus/qdbusmetatype.h b/src/dbus/qdbusmetatype.h index bb791c9636..060e8adf2e 100644 --- a/src/dbus/qdbusmetatype.h +++ b/src/dbus/qdbusmetatype.h @@ -84,7 +84,7 @@ int qDBusRegisterMetaType( void (*mf)(QDBusArgument &, const T *) = qDBusMarshallHelper; void (*df)(const QDBusArgument &, T *) = qDBusDemarshallHelper; - int id = qRegisterMetaType(); // make sure it's registered + int id = qMetaTypeId(); // make sure it's registered QDBusMetaType::registerMarshallOperators(id, reinterpret_cast(mf), reinterpret_cast(df));