From fad1fa65ed2a76539a229acaa83299875ce8b4c1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 24 May 2012 16:45:11 +0200 Subject: [PATCH] QtDBus: compile with QT_STRICT_ITERATORS Unlike most other modules, QtDBus in its use of QVector also needs to check if the item isn't null, which makes for some special changes. Change-Id: Ia22ad2a6b26c9c34dc09ab882d81323a941d166a Reviewed-by: Stephen Kelly --- src/dbus/qdbusconnection.cpp | 2 +- src/dbus/qdbusintegrator.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index 08a840c5c9..8afe714501 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -789,7 +789,7 @@ bool QDBusConnection::registerObject(const QString &path, QObject *object, Regis QDBusWriteLocker locker(RegisterObjectAction, d); // lower-bound search for where this object should enter in the tree - QDBusConnectionPrivate::ObjectTreeNode *node = &d->rootNode; + QDBusConnectionPrivate::ObjectTreeNode::DataList::Iterator node = &d->rootNode; int i = 1; while (node) { if (pathComponents.count() == i) { diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 35b40a16f9..e814724a56 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -442,7 +442,7 @@ static bool findObject(const QDBusConnectionPrivate::ObjectTreeNode *root, start = 1; // walk the object tree - const QDBusConnectionPrivate::ObjectTreeNode *node = root; + QDBusConnectionPrivate::ObjectTreeNode::DataList::ConstIterator node = root; while (start < length && node) { if (node->flags & QDBusConnection::ExportChildObjects) break; @@ -1538,7 +1538,7 @@ void QDBusActivateObjectEvent::placeMetaCall(QObject *) void QDBusConnectionPrivate::handleSignal(const QString &key, const QDBusMessage& msg) { - SignalHookHash::const_iterator it = signalHooks.find(key); + SignalHookHash::const_iterator it = signalHooks.constFind(key); SignalHookHash::const_iterator end = signalHooks.constEnd(); //qDebug("looking for: %s", path.toLocal8Bit().constData()); //qDBusDebug() << signalHooks.keys(); @@ -2071,7 +2071,7 @@ bool QDBusConnectionPrivate::connectSignal(const QString &service, return false; // don't connect // avoid duplicating: - QDBusConnectionPrivate::SignalHookHash::ConstIterator it = signalHooks.find(key); + QDBusConnectionPrivate::SignalHookHash::ConstIterator it = signalHooks.constFind(key); QDBusConnectionPrivate::SignalHookHash::ConstIterator end = signalHooks.constEnd(); for ( ; it != end && it.key() == key; ++it) { const QDBusConnectionPrivate::SignalHook &entry = it.value(); @@ -2252,7 +2252,7 @@ void QDBusConnectionPrivate::connectRelay(const QString &service, // add it to our list: QDBusWriteLocker locker(ConnectRelayAction, this); - SignalHookHash::ConstIterator it = signalHooks.find(key); + SignalHookHash::ConstIterator it = signalHooks.constFind(key); SignalHookHash::ConstIterator end = signalHooks.constEnd(); for ( ; it != end && it.key() == key; ++it) { const SignalHook &entry = it.value();