TreeModel: Remove unused function overload

9124833a63 introduced an optional
parameter to removeChildren to suppress signal emitting, and
a61f9162f1 reimplemented that in a ABI
compatible way with a new removeChildrenSilently method instead.

The code now uses removeChildrenSilently, so the parameter to
removeChildren is no longer needed.

Change-Id: I8411d80f90e83b8746c2553dddb41c3f40a2bfc7
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Eike Ziller
2024-01-09 09:58:27 +01:00
parent 33ef73daf9
commit 07a0ced947
2 changed files with 4 additions and 6 deletions

View File

@@ -700,17 +700,15 @@ void TreeItem::removeChildAt(int pos)
}
}
void TreeItem::removeChildren(bool emitSignals)
void TreeItem::removeChildren()
{
if (childCount() == 0)
return;
if (m_model) {
QModelIndex idx = index();
if (emitSignals)
m_model->beginRemoveRows(idx, 0, childCount() - 1);
m_model->beginRemoveRows(idx, 0, childCount() - 1);
clear();
if (emitSignals)
m_model->endRemoveRows();
m_model->endRemoveRows();
} else {
clear();
}

View File

@@ -38,7 +38,7 @@ public:
const std::function<bool(const TreeItem *, const TreeItem *)> &cmp);
void removeChildAt(int pos);
void removeChildren(bool emitSignals = true);
void removeChildren();
void removeChildrenSilently();
void sortChildren(const std::function<bool(const TreeItem *, const TreeItem *)> &cmp);
void update();