projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3640250
)
Replace deprecated QModelIndex::child with QAbstractItemModel::index
author
Janne Koschinski
<janne@kuschku.de>
Mon, 5 Aug 2019 10:37:13 +0000
(12:37 +0200)
committer
Manuel Nickschas
<sputnick@quassel-irc.org>
Wed, 28 Aug 2019 19:45:23 +0000
(21:45 +0200)
src/client/buffermodel.cpp
patch
|
blob
|
history
src/client/networkmodel.cpp
patch
|
blob
|
history
src/client/treemodel.cpp
patch
|
blob
|
history
src/qtui/nicklistwidget.cpp
patch
|
blob
|
history
src/uisupport/abstractbuffercontainer.cpp
patch
|
blob
|
history
src/uisupport/bufferview.cpp
patch
|
blob
|
history
src/uisupport/nickviewfilter.cpp
patch
|
blob
|
history
diff --git
a/src/client/buffermodel.cpp
b/src/client/buffermodel.cpp
index
d4a94ea
..
0836b06
100644
(file)
--- a/
src/client/buffermodel.cpp
+++ b/
src/client/buffermodel.cpp
@@
-138,7
+138,7
@@
void BufferModel::newBuffers(const QModelIndex& parent, int start, int end)
return;
for (int row = start; row <= end; row++) {
return;
for (int row = start; row <= end; row++) {
- QModelIndex child = parent.
child(row, 0
);
+ QModelIndex child = parent.
model()->index(row, 0, parent
);
newBuffer(child.data(NetworkModel::BufferIdRole).value<BufferId>());
}
}
newBuffer(child.data(NetworkModel::BufferIdRole).value<BufferId>());
}
}
diff --git
a/src/client/networkmodel.cpp
b/src/client/networkmodel.cpp
index
4713932
..
837601f
100644
(file)
--- a/
src/client/networkmodel.cpp
+++ b/
src/client/networkmodel.cpp
@@
-1520,7
+1520,7
@@
void NetworkModel::checkForRemovedBuffers(const QModelIndex& parent, int start,
return;
for (int row = start; row <= end; row++) {
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++) {
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());
}
}
_bufferItemCache[child.data(BufferIdRole).value<BufferId>()] = static_cast<BufferItem*>(child.internalPointer());
}
}
diff --git
a/src/client/treemodel.cpp
b/src/client/treemodel.cpp
index
d1cc465
..
2819353
100644
(file)
--- a/
src/client/treemodel.cpp
+++ b/
src/client/treemodel.cpp
@@
-571,7
+571,7
@@
void TreeModel::debug_rowsAboutToBeRemoved(const QModelIndex& parent, int start,
QModelIndex child;
for (int i = end; i >= start; i--) {
QModelIndex child;
for (int i = end; i >= start; i--) {
- child = parent.
child(i, 0
);
+ child = parent.
model()->index(i, 0, parent
);
Q_ASSERT(parentItem->child(i));
qDebug() << ">>>" << i << child << child.data().toString();
}
Q_ASSERT(parentItem->child(i));
qDebug() << ">>>" << i << child << child.data().toString();
}
@@
-587,7
+587,7
@@
void TreeModel::debug_rowsInserted(const QModelIndex& parent, int start, int end
QModelIndex child;
for (int i = start; i <= end; i++) {
QModelIndex child;
for (int i = start; i <= end; i++) {
- child = parent.
child(i, 0
);
+ child = parent.
model()->index(i, 0, parent
);
Q_ASSERT(parentItem->child(i));
qDebug() << "<<<" << i << child << child.data().toString();
}
Q_ASSERT(parentItem->child(i));
qDebug() << "<<<" << i << child << child.data().toString();
}
diff --git
a/src/qtui/nicklistwidget.cpp
b/src/qtui/nicklistwidget.cpp
index
fed4911
..
6ee4752
100644
(file)
--- a/
src/qtui/nicklistwidget.cpp
+++ b/
src/qtui/nicklistwidget.cpp
@@
-177,7
+177,7
@@
void NickListWidget::rowsAboutToBeRemoved(const QModelIndex& parent, int start,
else {
// check if there are explicitly buffers removed
for (int i = start; i <= end; i++) {
else {
// check if there are explicitly buffers removed
for (int i = start; i <= end; i++) {
- QVariant variant = parent.
child(i, 0
).data(NetworkModel::BufferIdRole);
+ QVariant variant = parent.
model()->index(i, 0, parent
).data(NetworkModel::BufferIdRole);
if (!variant.isValid())
continue;
if (!variant.isValid())
continue;
diff --git
a/src/uisupport/abstractbuffercontainer.cpp
b/src/uisupport/abstractbuffercontainer.cpp
index
f986c0b
..
ee34905
100644
(file)
--- a/
src/uisupport/abstractbuffercontainer.cpp
+++ b/
src/uisupport/abstractbuffercontainer.cpp
@@
-47,7
+47,7
@@
void AbstractBufferContainer::rowsAboutToBeRemoved(const QModelIndex& parent, in
else {
// check if there are explicitly buffers removed
for (int i = start; i <= end; i++) {
else {
// check if there are explicitly buffers removed
for (int i = start; i <= end; i++) {
- QVariant variant = parent.
child(i, 0
).data(NetworkModel::BufferIdRole);
+ QVariant variant = parent.
model()->index(i, 0, parent
).data(NetworkModel::BufferIdRole);
if (!variant.isValid())
continue;
if (!variant.isValid())
continue;
diff --git
a/src/uisupport/bufferview.cpp
b/src/uisupport/bufferview.cpp
index
a17c1a0
..
f603bf5
100644
(file)
--- a/
src/uisupport/bufferview.cpp
+++ b/
src/uisupport/bufferview.cpp
@@
-494,13
+494,13
@@
void BufferView::changeBuffer(Direction direction)
if (currentIndex.row() == 0)
newParent = lastNetIndex;
if (model()->hasChildren(newParent))
if (currentIndex.row() == 0)
newParent = lastNetIndex;
if (model()->hasChildren(newParent))
- resultingIndex = newParent.
child(model()->rowCount(newParent) - 1, 0
);
+ resultingIndex = newParent.
model()->index(model()->rowCount(newParent) - 1, 0, newParent
);
else
resultingIndex = newParent;
}
else {
if (model()->hasChildren(currentIndex))
else
resultingIndex = newParent;
}
else {
if (model()->hasChildren(currentIndex))
- resultingIndex = currentIndex.
child(0, 0
);
+ resultingIndex = currentIndex.
model()->index(0, 0, currentIndex
);
else
resultingIndex = currentIndex.sibling(currentIndex.row() + 1, 0);
}
else
resultingIndex = currentIndex.sibling(currentIndex.row() + 1, 0);
}
@@
-510,7
+510,7
@@
void BufferView::changeBuffer(Direction direction)
if (direction == Forward)
resultingIndex = model()->index(0, 0, QModelIndex());
else
if (direction == Forward)
resultingIndex = model()->index(0, 0, QModelIndex());
else
- resultingIndex = lastNetIndex.
child(model()->rowCount(lastNetIndex) - 1, 0
);
+ resultingIndex = lastNetIndex.
model()->index(model()->rowCount(lastNetIndex) - 1, 0, lastNetIndex
);
}
selectionModel()->setCurrentIndex(resultingIndex, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
}
selectionModel()->setCurrentIndex(resultingIndex, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
diff --git
a/src/uisupport/nickviewfilter.cpp
b/src/uisupport/nickviewfilter.cpp
index
3bb42f8
..
5058de7
100644
(file)
--- a/
src/uisupport/nickviewfilter.cpp
+++ b/
src/uisupport/nickviewfilter.cpp
@@
-44,7
+44,7
@@
bool NickViewFilter::filterAcceptsRow(int source_row, const QModelIndex& source_
if (!source_parent.isValid())
return true;
if (!source_parent.isValid())
return true;
- QModelIndex source_child = source_parent.
child(source_row, 0
);
+ QModelIndex source_child = source_parent.
model()->index(source_row, 0, source_parent
);
return (sourceModel()->data(source_child, NetworkModel::BufferIdRole).value<BufferId>() == _bufferId);
}
return (sourceModel()->data(source_child, NetworkModel::BufferIdRole).value<BufferId>() == _bufferId);
}