Replace deprecated QModelIndex::child with QAbstractItemModel::index
[quassel.git] / src / client / networkmodel.cpp
index 4713932..837601f 100644 (file)
@@ -1520,7 +1520,7 @@ void NetworkModel::checkForRemovedBuffers(const QModelIndex& parent, int start,
         return;
 
     for (int row = start; row <= end; row++) {
-        _bufferItemCache.remove(parent.child(row, 0).data(BufferIdRole).value<BufferId>());
+        _bufferItemCache.remove(index(row, 0, parent).data(BufferIdRole).value<BufferId>());
     }
 }
 
@@ -1530,7 +1530,7 @@ void NetworkModel::checkForNewBuffers(const QModelIndex& parent, int start, int
         return;
 
     for (int row = start; row <= end; row++) {
-        QModelIndex child = parent.child(row, 0);
+        QModelIndex child = parent.model()->index(row, 0, parent);
         _bufferItemCache[child.data(BufferIdRole).value<BufferId>()] = static_cast<BufferItem*>(child.internalPointer());
     }
 }