diff options
author | Marius Storm-Olsen <marius@trolltech.com> | 2009-06-30 10:58:16 (GMT) |
---|---|---|
committer | Marius Storm-Olsen <marius@trolltech.com> | 2009-06-30 10:58:16 (GMT) |
commit | 116683d4284646d91013e6f3a8d940c8855fbca3 (patch) | |
tree | 93bdc46bec4f274ef28939e1840cdfc39bcfcc05 /src/dbus | |
parent | 5a54b2c4c448ea22adb56bc191303abca34f230b (diff) | |
parent | 238a618b5482e0471f46ed71362492be9c4df4a6 (diff) | |
download | Qt-116683d4284646d91013e6f3a8d940c8855fbca3.zip Qt-116683d4284646d91013e6f3a8d940c8855fbca3.tar.gz Qt-116683d4284646d91013e6f3a8d940c8855fbca3.tar.bz2 |
Merge branch '4.5'
Diffstat (limited to 'src/dbus')
-rw-r--r-- | src/dbus/qdbusmessage.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/dbus/qdbusmessage.cpp b/src/dbus/qdbusmessage.cpp index 47dd34b..9150295 100644 --- a/src/dbus/qdbusmessage.cpp +++ b/src/dbus/qdbusmessage.cpp @@ -108,8 +108,11 @@ DBusMessage *QDBusMessagePrivate::toDBusMessage(const QDBusMessage &message) //qDebug() << "QDBusMessagePrivate::toDBusMessage" << "message is invalid"; break; case DBUS_MESSAGE_TYPE_METHOD_CALL: - msg = q_dbus_message_new_method_call(data(d_ptr->service.toUtf8()), data(d_ptr->path.toUtf8()), - data(d_ptr->interface.toUtf8()), data(d_ptr->name.toUtf8())); + // only interface can be empty + if (d_ptr->service.isEmpty() || d_ptr->path.isEmpty() || d_ptr->name.isEmpty()) + break; + msg = q_dbus_message_new_method_call(d_ptr->service.toUtf8(), d_ptr->path.toUtf8(), + data(d_ptr->interface.toUtf8()), d_ptr->name.toUtf8()); break; case DBUS_MESSAGE_TYPE_METHOD_RETURN: msg = q_dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN); @@ -119,16 +122,22 @@ DBusMessage *QDBusMessagePrivate::toDBusMessage(const QDBusMessage &message) } break; case DBUS_MESSAGE_TYPE_ERROR: + // error name can't be empty + if (d_ptr->name.isEmpty()) + break; msg = q_dbus_message_new(DBUS_MESSAGE_TYPE_ERROR); - q_dbus_message_set_error_name(msg, data(d_ptr->name.toUtf8())); + q_dbus_message_set_error_name(msg, d_ptr->name.toUtf8()); if (!d_ptr->localMessage) { q_dbus_message_set_destination(msg, q_dbus_message_get_sender(d_ptr->reply)); q_dbus_message_set_reply_serial(msg, q_dbus_message_get_serial(d_ptr->reply)); } break; case DBUS_MESSAGE_TYPE_SIGNAL: - msg = q_dbus_message_new_signal(data(d_ptr->path.toUtf8()), data(d_ptr->interface.toUtf8()), - data(d_ptr->name.toUtf8())); + // nothing can be empty here + if (d_ptr->path.isEmpty() || d_ptr->interface.isEmpty() || d_ptr->name.isEmpty()) + break; + msg = q_dbus_message_new_signal(d_ptr->path.toUtf8(), d_ptr->interface.toUtf8(), + d_ptr->name.toUtf8()); break; default: Q_ASSERT(false); |