QtDBus: compile with QT_STRICT_ITERATORS
authorThiago Macieira <thiago.macieira@intel.com>
Thu, 24 May 2012 14:45:11 +0000 (16:45 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 29 May 2012 09:35:21 +0000 (11:35 +0200)
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 <stephen.kelly@kdab.com>
src/dbus/qdbusconnection.cpp
src/dbus/qdbusintegrator.cpp

index 08a840c..8afe714 100644 (file)
@@ -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) {
index 35b40a1..e814724 100644 (file)
@@ -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();