1177 void QDBusConnectionPrivate::_q_serviceOwnerChanged(const QString &name, |
1176 void QDBusConnectionPrivate::_q_serviceOwnerChanged(const QString &name, |
1178 const QString &oldOwner, const QString &newOwner) |
1177 const QString &oldOwner, const QString &newOwner) |
1179 { |
1178 { |
1180 Q_UNUSED(oldOwner); |
1179 Q_UNUSED(oldOwner); |
1181 QDBusWriteLocker locker(UpdateSignalHookOwnerAction, this); |
1180 QDBusWriteLocker locker(UpdateSignalHookOwnerAction, this); |
1182 QMutableHashIterator<QString, SignalHook> it(signalHooks); |
1181 WatchedServicesHash::Iterator it = watchedServices.find(name); |
1183 it.toFront(); |
1182 if (it == watchedServices.end()) |
1184 while (it.hasNext()) |
1183 return; |
1185 if (it.next().value().service == name) |
1184 if (oldOwner != it->owner) |
1186 it.value().owner = newOwner; |
1185 qWarning("QDBusConnection: name '%s' had owner '%s' but we thought it was '%s'", |
|
1186 qPrintable(name), qPrintable(oldOwner), qPrintable(it->owner)); |
|
1187 |
|
1188 qDBusDebug() << this << "Updating name" << name << "from" << oldOwner << "to" << newOwner; |
|
1189 it->owner = newOwner; |
1187 } |
1190 } |
1188 |
1191 |
1189 int QDBusConnectionPrivate::findSlot(QObject* obj, const QByteArray &normalizedName, |
1192 int QDBusConnectionPrivate::findSlot(QObject* obj, const QByteArray &normalizedName, |
1190 QList<int> ¶ms) |
1193 QList<int> ¶ms) |
1191 { |
1194 { |
1486 SignalHookHash::const_iterator end = signalHooks.constEnd(); |
1488 SignalHookHash::const_iterator end = signalHooks.constEnd(); |
1487 //qDebug("looking for: %s", path.toLocal8Bit().constData()); |
1489 //qDebug("looking for: %s", path.toLocal8Bit().constData()); |
1488 //qDBusDebug() << signalHooks.keys(); |
1490 //qDBusDebug() << signalHooks.keys(); |
1489 for ( ; it != end && it.key() == key; ++it) { |
1491 for ( ; it != end && it.key() == key; ++it) { |
1490 const SignalHook &hook = it.value(); |
1492 const SignalHook &hook = it.value(); |
1491 if (!hook.owner.isNull() && hook.owner != msg.service()) |
1493 if (!hook.service.isEmpty()) { |
1492 continue; |
1494 const QString owner = |
|
1495 shouldWatchService(hook.service) ? |
|
1496 watchedServices.value(hook.service).owner : |
|
1497 hook.service; |
|
1498 if (owner != msg.service()) |
|
1499 continue; |
|
1500 } |
1493 if (!hook.path.isEmpty() && hook.path != msg.path()) |
1501 if (!hook.path.isEmpty() && hook.path != msg.path()) |
1494 continue; |
1502 continue; |
1495 if (!hook.signature.isEmpty() && hook.signature != msg.signature()) |
1503 if (!hook.signature.isEmpty() && hook.signature != msg.signature()) |
1496 continue; |
1504 continue; |
1497 if (hook.signature.isEmpty() && !hook.signature.isNull() && !msg.signature().isEmpty()) |
1505 if (hook.signature.isEmpty() && !hook.signature.isNull() && !msg.signature().isEmpty()) |
1650 } else { |
1658 } else { |
1651 qWarning("QDBusConnectionPrivate::setConnection: Unable to get base service"); |
1659 qWarning("QDBusConnectionPrivate::setConnection: Unable to get base service"); |
1652 } |
1660 } |
1653 |
1661 |
1654 QString busService = QLatin1String(DBUS_SERVICE_DBUS); |
1662 QString busService = QLatin1String(DBUS_SERVICE_DBUS); |
1655 connectSignal(busService, QString(), QString(), QString(), QLatin1String("NameAcquired"), QStringList(), QString(), |
1663 connectSignal(busService, QString(), QString(), QLatin1String("NameAcquired"), QStringList(), QString(), |
1656 this, SLOT(registerService(QString))); |
1664 this, SLOT(registerService(QString))); |
1657 connectSignal(busService, QString(), QString(), QString(), QLatin1String("NameLost"), QStringList(), QString(), |
1665 connectSignal(busService, QString(), QString(), QLatin1String("NameLost"), QStringList(), QString(), |
1658 this, SLOT(unregisterService(QString))); |
1666 this, SLOT(unregisterService(QString))); |
1659 |
1667 |
1660 |
1668 |
1661 q_dbus_connection_add_filter(connection, qDBusSignalFilter, this, 0); |
1669 q_dbus_connection_add_filter(connection, qDBusSignalFilter, this, 0); |
1662 |
1670 |
1663 //qDebug("base service: %s", service); |
1671 qDBusDebug() << this << ": connected successfully"; |
1664 |
1672 |
1665 // schedule a dispatch: |
1673 // schedule a dispatch: |
1666 QMetaObject::invokeMethod(this, "doDispatch", Qt::QueuedConnection); |
1674 QMetaObject::invokeMethod(this, "doDispatch", Qt::QueuedConnection); |
1667 } |
1675 } |
1668 |
1676 |
1806 return QDBusMessage::createError(err); |
1814 return QDBusMessage::createError(err); |
1807 } |
1815 } |
1808 |
1816 |
1809 QDBusMessage amsg = QDBusMessagePrivate::fromDBusMessage(reply); |
1817 QDBusMessage amsg = QDBusMessagePrivate::fromDBusMessage(reply); |
1810 q_dbus_message_unref(reply); |
1818 q_dbus_message_unref(reply); |
1811 qDBusDebug() << QThread::currentThread() << "got message reply (blocking):" << amsg; |
1819 qDBusDebug() << this << "got message reply (blocking):" << amsg; |
1812 |
1820 |
1813 return amsg; |
1821 return amsg; |
1814 } else { // use the event loop |
1822 } else { // use the event loop |
1815 QDBusPendingCallPrivate *pcall = sendWithReplyAsync(message, timeout); |
1823 QDBusPendingCallPrivate *pcall = sendWithReplyAsync(message, timeout); |
1816 Q_ASSERT(pcall); |
1824 Q_ASSERT(pcall); |
1817 |
1825 |
1818 if (pcall->replyMessage.type() != QDBusMessage::InvalidMessage) { |
1826 if (pcall->replyMessage.type() == QDBusMessage::InvalidMessage) { |
1819 pcall->watcherHelper = new QDBusPendingCallWatcherHelper; |
1827 pcall->watcherHelper = new QDBusPendingCallWatcherHelper; |
1820 QEventLoop loop; |
1828 QEventLoop loop; |
1821 loop.connect(pcall->watcherHelper, SIGNAL(reply(QDBusMessage)), SLOT(quit())); |
1829 loop.connect(pcall->watcherHelper, SIGNAL(reply(QDBusMessage)), SLOT(quit())); |
1822 loop.connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), SLOT(quit())); |
1830 loop.connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), SLOT(quit())); |
1823 |
1831 |
1927 int timeout) |
1935 int timeout) |
1928 { |
1936 { |
1929 QDBusPendingCallPrivate *pcall = sendWithReplyAsync(message, timeout); |
1937 QDBusPendingCallPrivate *pcall = sendWithReplyAsync(message, timeout); |
1930 Q_ASSERT(pcall); |
1938 Q_ASSERT(pcall); |
1931 |
1939 |
1932 // has it already finished (dispatched locally)? |
1940 // has it already finished with success (dispatched locally)? |
1933 if (pcall->replyMessage.type() == QDBusMessage::ReplyMessage) { |
1941 if (pcall->replyMessage.type() == QDBusMessage::ReplyMessage) { |
1934 pcall->setReplyCallback(receiver, returnMethod); |
1942 pcall->setReplyCallback(receiver, returnMethod); |
1935 processFinishedCall(pcall); |
1943 processFinishedCall(pcall); |
1936 delete pcall; |
1944 delete pcall; |
1937 return 1; |
1945 return 1; |
1938 } |
1946 } |
1939 |
1947 |
|
1948 // either it hasn't finished or it has finished with error |
|
1949 if (errorMethod) { |
|
1950 pcall->watcherHelper = new QDBusPendingCallWatcherHelper; |
|
1951 connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod, |
|
1952 Qt::QueuedConnection); |
|
1953 pcall->watcherHelper->moveToThread(thread()); |
|
1954 } |
|
1955 |
1940 // has it already finished and is an error reply message? |
1956 // has it already finished and is an error reply message? |
1941 if (pcall->replyMessage.type() == QDBusMessage::ErrorMessage) { |
1957 if (pcall->replyMessage.type() == QDBusMessage::ErrorMessage) { |
1942 if (errorMethod) { |
|
1943 pcall->watcherHelper = new QDBusPendingCallWatcherHelper; |
|
1944 connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod); |
|
1945 pcall->watcherHelper->moveToThread(thread()); |
|
1946 } |
|
1947 processFinishedCall(pcall); |
1958 processFinishedCall(pcall); |
1948 delete pcall; |
1959 delete pcall; |
1949 return 1; |
1960 return 1; |
1950 } |
1961 } |
1951 |
1962 |
1952 // has it already finished with error? |
|
1953 if (pcall->replyMessage.type() != QDBusMessage::InvalidMessage) { |
|
1954 delete pcall; |
|
1955 return 0; |
|
1956 } |
|
1957 |
|
1958 pcall->autoDelete = true; |
1963 pcall->autoDelete = true; |
1959 pcall->ref.ref(); |
1964 pcall->ref.ref(); |
1960 |
|
1961 pcall->setReplyCallback(receiver, returnMethod); |
1965 pcall->setReplyCallback(receiver, returnMethod); |
1962 if (errorMethod) { |
|
1963 pcall->watcherHelper = new QDBusPendingCallWatcherHelper; |
|
1964 connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod); |
|
1965 pcall->watcherHelper->moveToThread(thread()); |
|
1966 } |
|
1967 |
1966 |
1968 return 1; |
1967 return 1; |
1969 } |
1968 } |
1970 |
1969 |
1971 bool QDBusConnectionPrivate::connectSignal(const QString &service, const QString &owner, |
1970 bool QDBusConnectionPrivate::connectSignal(const QString &service, |
1972 const QString &path, const QString &interface, const QString &name, |
1971 const QString &path, const QString &interface, const QString &name, |
1973 const QStringList &argumentMatch, const QString &signature, |
1972 const QStringList &argumentMatch, const QString &signature, |
1974 QObject *receiver, const char *slot) |
1973 QObject *receiver, const char *slot) |
1975 { |
1974 { |
1976 // check the slot |
1975 // check the slot |
1979 QString name2 = name; |
1978 QString name2 = name; |
1980 if (name2.isNull()) |
1979 if (name2.isNull()) |
1981 name2.detach(); |
1980 name2.detach(); |
1982 |
1981 |
1983 hook.signature = signature; |
1982 hook.signature = signature; |
1984 if (!prepareHook(hook, key, service, owner, path, interface, name, argumentMatch, receiver, slot, 0, false)) |
1983 if (!prepareHook(hook, key, service, path, interface, name, argumentMatch, receiver, slot, 0, false)) |
1985 return false; // don't connect |
1984 return false; // don't connect |
1986 |
1985 |
1987 // avoid duplicating: |
1986 // avoid duplicating: |
1988 QDBusConnectionPrivate::SignalHookHash::ConstIterator it = signalHooks.find(key); |
1987 QDBusConnectionPrivate::SignalHookHash::ConstIterator it = signalHooks.find(key); |
1989 QDBusConnectionPrivate::SignalHookHash::ConstIterator end = signalHooks.constEnd(); |
1988 QDBusConnectionPrivate::SignalHookHash::ConstIterator end = signalHooks.constEnd(); |
1990 for ( ; it != end && it.key() == key; ++it) { |
1989 for ( ; it != end && it.key() == key; ++it) { |
1991 const QDBusConnectionPrivate::SignalHook &entry = it.value(); |
1990 const QDBusConnectionPrivate::SignalHook &entry = it.value(); |
1992 if (entry.service == hook.service && |
1991 if (entry.service == hook.service && |
1993 entry.owner == hook.owner && |
|
1994 entry.path == hook.path && |
1992 entry.path == hook.path && |
1995 entry.signature == hook.signature && |
1993 entry.signature == hook.signature && |
1996 entry.obj == hook.obj && |
1994 entry.obj == hook.obj && |
1997 entry.midx == hook.midx) { |
1995 entry.midx == hook.midx && |
|
1996 entry.argumentMatch == hook.argumentMatch) { |
1998 // no need to compare the parameters if it's the same slot |
1997 // no need to compare the parameters if it's the same slot |
1999 return true; // already there |
1998 return true; // already there |
2000 } |
1999 } |
2001 } |
2000 } |
2002 |
2001 |
2033 Q_ASSERT(false); |
2032 Q_ASSERT(false); |
2034 } else { |
2033 } else { |
2035 // Successfully connected the signal |
2034 // Successfully connected the signal |
2036 // Do we need to watch for this name? |
2035 // Do we need to watch for this name? |
2037 if (shouldWatchService(hook.service)) { |
2036 if (shouldWatchService(hook.service)) { |
2038 WatchedServicesHash::Iterator it = watchedServiceNames.find(hook.service); |
2037 WatchedServicesHash::mapped_type &data = watchedServices[hook.service]; |
2039 if (it != watchedServiceNames.end()) { |
2038 if (++data.refcount == 1) { |
2040 // already watching |
|
2041 ++it.value(); |
|
2042 } else { |
|
2043 // we need to watch for this service changing |
2039 // we need to watch for this service changing |
2044 QString dbusServerService = QLatin1String(DBUS_SERVICE_DBUS); |
2040 QString dbusServerService = QLatin1String(DBUS_SERVICE_DBUS); |
2045 connectSignal(dbusServerService, dbusServerService, QString(), QLatin1String(DBUS_INTERFACE_DBUS), |
2041 connectSignal(dbusServerService, QString(), QLatin1String(DBUS_INTERFACE_DBUS), |
2046 QLatin1String("NameOwnerChanged"), QStringList() << hook.service, QString(), |
2042 QLatin1String("NameOwnerChanged"), QStringList() << hook.service, QString(), |
2047 this, SLOT(_q_serviceOwnerChanged(QString,QString,QString))); |
2043 this, SLOT(_q_serviceOwnerChanged(QString,QString,QString))); |
|
2044 data.owner = getNameOwnerNoCache(hook.service); |
|
2045 qDBusDebug() << this << "Watching service" << hook.service << "for owner changes (current owner:" |
|
2046 << data.owner << ")"; |
2048 } |
2047 } |
2049 } |
2048 } |
2050 } |
2049 } |
2051 } |
2050 } |
2052 } |
2051 } |
2062 QString name2 = name; |
2061 QString name2 = name; |
2063 if (name2.isNull()) |
2062 if (name2.isNull()) |
2064 name2.detach(); |
2063 name2.detach(); |
2065 |
2064 |
2066 hook.signature = signature; |
2065 hook.signature = signature; |
2067 if (!prepareHook(hook, key, service, QString(), path, interface, name, argumentMatch, receiver, slot, 0, false)) |
2066 if (!prepareHook(hook, key, service, path, interface, name, argumentMatch, receiver, slot, 0, false)) |
2068 return false; // don't disconnect |
2067 return false; // don't disconnect |
2069 |
2068 |
2070 // avoid duplicating: |
2069 // avoid duplicating: |
2071 QDBusConnectionPrivate::SignalHookHash::Iterator it = signalHooks.find(key); |
2070 QDBusConnectionPrivate::SignalHookHash::Iterator it = signalHooks.find(key); |
2072 QDBusConnectionPrivate::SignalHookHash::Iterator end = signalHooks.end(); |
2071 QDBusConnectionPrivate::SignalHookHash::Iterator end = signalHooks.end(); |
2073 for ( ; it != end && it.key() == key; ++it) { |
2072 for ( ; it != end && it.key() == key; ++it) { |
2074 const QDBusConnectionPrivate::SignalHook &entry = it.value(); |
2073 const QDBusConnectionPrivate::SignalHook &entry = it.value(); |
2075 if (entry.service == hook.service && |
2074 if (entry.service == hook.service && |
2076 //entry.owner == hook.owner && |
|
2077 entry.path == hook.path && |
2075 entry.path == hook.path && |
2078 entry.signature == hook.signature && |
2076 entry.signature == hook.signature && |
2079 entry.obj == hook.obj && |
2077 entry.obj == hook.obj && |
2080 entry.midx == hook.midx) { |
2078 entry.midx == hook.midx && |
|
2079 entry.argumentMatch == hook.argumentMatch) { |
2081 // no need to compare the parameters if it's the same slot |
2080 // no need to compare the parameters if it's the same slot |
2082 disconnectSignal(it); |
2081 disconnectSignal(it); |
2083 return true; // it was there |
2082 return true; // it was there |
2084 } |
2083 } |
2085 } |
2084 } |
2090 |
2089 |
2091 QDBusConnectionPrivate::SignalHookHash::Iterator |
2090 QDBusConnectionPrivate::SignalHookHash::Iterator |
2092 QDBusConnectionPrivate::disconnectSignal(SignalHookHash::Iterator &it) |
2091 QDBusConnectionPrivate::disconnectSignal(SignalHookHash::Iterator &it) |
2093 { |
2092 { |
2094 const SignalHook &hook = it.value(); |
2093 const SignalHook &hook = it.value(); |
2095 |
|
2096 WatchedServicesHash::Iterator sit = watchedServiceNames.find(hook.service); |
|
2097 if (sit != watchedServiceNames.end()) { |
|
2098 if (sit.value() == 1) { |
|
2099 watchedServiceNames.erase(sit); |
|
2100 QString dbusServerService = QLatin1String(DBUS_SERVICE_DBUS); |
|
2101 disconnectSignal(dbusServerService, QString(), QLatin1String(DBUS_INTERFACE_DBUS), |
|
2102 QLatin1String("NameOwnerChanged"), QStringList() << hook.service, QString(), |
|
2103 this, SLOT(_q_serviceOwnerChanged(QString,QString,QString))); |
|
2104 } else { |
|
2105 --sit.value(); |
|
2106 } |
|
2107 } |
|
2108 |
2094 |
2109 bool erase = false; |
2095 bool erase = false; |
2110 MatchRefCountHash::iterator i = matchRefCounts.find(hook.matchRule); |
2096 MatchRefCountHash::iterator i = matchRefCounts.find(hook.matchRule); |
2111 if (i == matchRefCounts.end()) { |
2097 if (i == matchRefCounts.end()) { |
2112 qWarning("QDBusConnectionPrivate::disconnectSignal: MatchRule not found in matchRefCounts!!"); |
2098 qWarning("QDBusConnectionPrivate::disconnectSignal: MatchRule not found in matchRefCounts!!"); |
2122 |
2108 |
2123 // we don't care about errors here |
2109 // we don't care about errors here |
2124 if (connection && erase) { |
2110 if (connection && erase) { |
2125 qDBusDebug("Removing rule: %s", hook.matchRule.constData()); |
2111 qDBusDebug("Removing rule: %s", hook.matchRule.constData()); |
2126 q_dbus_bus_remove_match(connection, hook.matchRule, NULL); |
2112 q_dbus_bus_remove_match(connection, hook.matchRule, NULL); |
|
2113 |
|
2114 // Successfully disconnected the signal |
|
2115 // Were we watching for this name? |
|
2116 WatchedServicesHash::Iterator sit = watchedServices.find(hook.service); |
|
2117 if (sit != watchedServices.end()) { |
|
2118 if (--sit.value().refcount == 0) { |
|
2119 watchedServices.erase(sit); |
|
2120 QString dbusServerService = QLatin1String(DBUS_SERVICE_DBUS); |
|
2121 disconnectSignal(dbusServerService, QString(), QLatin1String(DBUS_INTERFACE_DBUS), |
|
2122 QLatin1String("NameOwnerChanged"), QStringList() << hook.service, QString(), |
|
2123 this, SLOT(_q_serviceOwnerChanged(QString,QString,QString))); |
|
2124 } |
|
2125 } |
|
2126 |
2127 } |
2127 } |
2128 |
2128 |
2129 return signalHooks.erase(it); |
2129 return signalHooks.erase(it); |
2130 } |
2130 } |
2131 |
2131 |
2152 this, SLOT(relaySignal(QObject*,const QMetaObject*,int,QVariantList)), |
2152 this, SLOT(relaySignal(QObject*,const QMetaObject*,int,QVariantList)), |
2153 Qt::DirectConnection); |
2153 Qt::DirectConnection); |
2154 } |
2154 } |
2155 } |
2155 } |
2156 |
2156 |
2157 void QDBusConnectionPrivate::connectRelay(const QString &service, const QString &owner, |
2157 void QDBusConnectionPrivate::connectRelay(const QString &service, |
2158 const QString &path, const QString &interface, |
2158 const QString &path, const QString &interface, |
2159 QDBusAbstractInterface *receiver, |
2159 QDBusAbstractInterface *receiver, |
2160 const char *signal) |
2160 const char *signal) |
2161 { |
2161 { |
2162 // this function is called by QDBusAbstractInterface when one of its signals is connected |
2162 // this function is called by QDBusAbstractInterface when one of its signals is connected |
2163 // we set up a relay from D-Bus into it |
2163 // we set up a relay from D-Bus into it |
2164 SignalHook hook; |
2164 SignalHook hook; |
2165 QString key; |
2165 QString key; |
2166 |
2166 |
2167 if (!prepareHook(hook, key, service, owner, path, interface, QString(), QStringList(), receiver, signal, |
2167 if (!prepareHook(hook, key, service, path, interface, QString(), QStringList(), receiver, signal, |
2168 QDBusAbstractInterface::staticMetaObject.methodCount(), true)) |
2168 QDBusAbstractInterface::staticMetaObject.methodCount(), true)) |
2169 return; // don't connect |
2169 return; // don't connect |
2170 |
2170 |
2171 // add it to our list: |
2171 // add it to our list: |
2172 QDBusWriteLocker locker(ConnectRelayAction, this); |
2172 QDBusWriteLocker locker(ConnectRelayAction, this); |
2173 SignalHookHash::ConstIterator it = signalHooks.find(key); |
2173 SignalHookHash::ConstIterator it = signalHooks.find(key); |
2174 SignalHookHash::ConstIterator end = signalHooks.constEnd(); |
2174 SignalHookHash::ConstIterator end = signalHooks.constEnd(); |
2175 for ( ; it != end && it.key() == key; ++it) { |
2175 for ( ; it != end && it.key() == key; ++it) { |
2176 const SignalHook &entry = it.value(); |
2176 const SignalHook &entry = it.value(); |
2177 if (entry.service == hook.service && |
2177 if (entry.service == hook.service && |
2178 entry.owner == hook.owner && |
|
2179 entry.path == hook.path && |
2178 entry.path == hook.path && |
2180 entry.signature == hook.signature && |
2179 entry.signature == hook.signature && |
2181 entry.obj == hook.obj && |
2180 entry.obj == hook.obj && |
2182 entry.midx == hook.midx) |
2181 entry.midx == hook.midx) |
2183 return; // already there, no need to re-add |
2182 return; // already there, no need to re-add |
2184 } |
2183 } |
2185 |
2184 |
2186 connectSignal(key, hook); |
2185 connectSignal(key, hook); |
2187 } |
2186 } |
2188 |
2187 |
2189 void QDBusConnectionPrivate::disconnectRelay(const QString &service, const QString &owner, |
2188 void QDBusConnectionPrivate::disconnectRelay(const QString &service, |
2190 const QString &path, const QString &interface, |
2189 const QString &path, const QString &interface, |
2191 QDBusAbstractInterface *receiver, |
2190 QDBusAbstractInterface *receiver, |
2192 const char *signal) |
2191 const char *signal) |
2193 { |
2192 { |
2194 // this function is called by QDBusAbstractInterface when one of its signals is disconnected |
2193 // this function is called by QDBusAbstractInterface when one of its signals is disconnected |
2195 // we remove relay from D-Bus into it |
2194 // we remove relay from D-Bus into it |
2196 SignalHook hook; |
2195 SignalHook hook; |
2197 QString key; |
2196 QString key; |
2198 |
2197 |
2199 if (!prepareHook(hook, key, service, owner, path, interface, QString(), QStringList(), receiver, signal, |
2198 if (!prepareHook(hook, key, service, path, interface, QString(), QStringList(), receiver, signal, |
2200 QDBusAbstractInterface::staticMetaObject.methodCount(), true)) |
2199 QDBusAbstractInterface::staticMetaObject.methodCount(), true)) |
2201 return; // don't connect |
2200 return; // don't connect |
2202 |
2201 |
2203 // remove it from our list: |
2202 // remove it from our list: |
2204 QDBusWriteLocker locker(DisconnectRelayAction, this); |
2203 QDBusWriteLocker locker(DisconnectRelayAction, this); |
2205 SignalHookHash::Iterator it = signalHooks.find(key); |
2204 SignalHookHash::Iterator it = signalHooks.find(key); |
2206 SignalHookHash::Iterator end = signalHooks.end(); |
2205 SignalHookHash::Iterator end = signalHooks.end(); |
2207 for ( ; it != end && it.key() == key; ++it) { |
2206 for ( ; it != end && it.key() == key; ++it) { |
2208 const SignalHook &entry = it.value(); |
2207 const SignalHook &entry = it.value(); |
2209 if (entry.service == hook.service && |
2208 if (entry.service == hook.service && |
2210 entry.owner == hook.owner && |
|
2211 entry.path == hook.path && |
2209 entry.path == hook.path && |
2212 entry.signature == hook.signature && |
2210 entry.signature == hook.signature && |
2213 entry.obj == hook.obj && |
2211 entry.obj == hook.obj && |
2214 entry.midx == hook.midx) { |
2212 entry.midx == hook.midx) { |
2215 // found it |
2213 // found it |