diff options
Diffstat (limited to 'src/dbus/qdbusintegrator.cpp')
-rw-r--r-- | src/dbus/qdbusintegrator.cpp | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 698fb1b46c..6edf08ebbe 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ ** ** This file is part of the QtDBus module of the Qt Toolkit. ** @@ -10,9 +10,9 @@ ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -23,8 +23,8 @@ ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ @@ -91,18 +91,22 @@ static inline QString dbusInterfaceString() static inline QDebug operator<<(QDebug dbg, const QThread *th) { - dbg.nospace() << "QThread(ptr=" << (void*)th; + QDebugStateSaver saver(dbg); + dbg.nospace() << "QThread(ptr=" << (const void*)th; if (th && !th->objectName().isEmpty()) dbg.nospace() << ", name=" << th->objectName(); + else if (th) + dbg.nospace() << ", name=" << th->metaObject()->className(); dbg.nospace() << ')'; - return dbg.space(); + return dbg; } #if QDBUS_THREAD_DEBUG static inline QDebug operator<<(QDebug dbg, const QDBusConnectionPrivate *conn) { + QDebugStateSaver saver(dbg); dbg.nospace() << "QDBusConnection(" - << "ptr=" << (void*)conn + << "ptr=" << (const void*)conn << ", name=" << conn->name << ", baseService=" << conn->baseService << ", thread="; @@ -111,7 +115,7 @@ static inline QDebug operator<<(QDebug dbg, const QDBusConnectionPrivate *conn) else dbg.nospace() << conn->thread(); dbg.nospace() << ')'; - return dbg.space(); + return dbg; } void qdbusDefaultThreadDebug(int action, int condition, QDBusConnectionPrivate *conn) @@ -399,7 +403,7 @@ static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, v QDBusConnectionPrivate *newConnection = new QDBusConnectionPrivate(serverConnection->parent()); QMutexLocker locker(&QDBusConnectionManager::instance()->mutex); - QDBusConnectionManager::instance()->setConnection(QLatin1String("QDBusServer-") + QString::number(reinterpret_cast<qulonglong>(newConnection)), newConnection); + QDBusConnectionManager::instance()->setConnection(QLatin1String("QDBusServer-") + QString::number(reinterpret_cast<qulonglong>(newConnection), 16), newConnection); serverConnection->serverConnectionNames << newConnection->name; // setPeer does the error handling for us @@ -986,12 +990,10 @@ void QDBusConnectionPrivate::deliverCall(QObject *object, int /*flags*/, const Q // FIXME: save the old sender! QDBusContextPrivate context(QDBusConnection(this), msg); QDBusContextPrivate *old = QDBusContextPrivate::set(object, &context); - QDBusConnectionPrivate::setSender(this); QPointer<QObject> ptr = object; fail = object->qt_metacall(QMetaObject::InvokeMetaMethod, slotIdx, params.data()) >= 0; - QDBusConnectionPrivate::setSender(0); // the object might be deleted in the slot if (!ptr.isNull()) QDBusContextPrivate::set(object, old); @@ -1025,7 +1027,7 @@ QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p) { static const bool threads = q_dbus_threads_init_default(); if (::isDebugging == -1) - ::isDebugging = qgetenv("QDBUS_DEBUG").toInt(); + ::isDebugging = qEnvironmentVariableIntValue("QDBUS_DEBUG"); Q_UNUSED(threads) #ifdef QDBUS_THREAD_DEBUG @@ -1481,8 +1483,12 @@ void QDBusConnectionPrivate::activateObject(ObjectTreeNode &node, const QDBusMes if (node.flags & (QDBusConnection::ExportScriptableSlots|QDBusConnection::ExportNonScriptableSlots) || node.flags & (QDBusConnection::ExportScriptableInvokables|QDBusConnection::ExportNonScriptableInvokables)) { bool interfaceFound = true; - if (!msg.interface().isEmpty()) - interfaceFound = qDBusInterfaceInObject(node.obj, msg.interface()); + if (!msg.interface().isEmpty()) { + if (!node.interfaceName.isEmpty()) + interfaceFound = msg.interface() == node.interfaceName; + else + interfaceFound = qDBusInterfaceInObject(node.obj, msg.interface()); + } if (interfaceFound) { if (!activateCall(node.obj, node.flags, msg)) |