forked from qt-creator/qt-creator
TreeModel: Remove unused function overload
9124833a63
introduced an optional parameter to removeChildren to suppress signal emitting, anda61f9162f1
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:
@@ -700,16 +700,14 @@ void TreeItem::removeChildAt(int pos)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TreeItem::removeChildren(bool emitSignals)
|
void TreeItem::removeChildren()
|
||||||
{
|
{
|
||||||
if (childCount() == 0)
|
if (childCount() == 0)
|
||||||
return;
|
return;
|
||||||
if (m_model) {
|
if (m_model) {
|
||||||
QModelIndex idx = index();
|
QModelIndex idx = index();
|
||||||
if (emitSignals)
|
|
||||||
m_model->beginRemoveRows(idx, 0, childCount() - 1);
|
m_model->beginRemoveRows(idx, 0, childCount() - 1);
|
||||||
clear();
|
clear();
|
||||||
if (emitSignals)
|
|
||||||
m_model->endRemoveRows();
|
m_model->endRemoveRows();
|
||||||
} else {
|
} else {
|
||||||
clear();
|
clear();
|
||||||
|
@@ -38,7 +38,7 @@ public:
|
|||||||
const std::function<bool(const TreeItem *, const TreeItem *)> &cmp);
|
const std::function<bool(const TreeItem *, const TreeItem *)> &cmp);
|
||||||
|
|
||||||
void removeChildAt(int pos);
|
void removeChildAt(int pos);
|
||||||
void removeChildren(bool emitSignals = true);
|
void removeChildren();
|
||||||
void removeChildrenSilently();
|
void removeChildrenSilently();
|
||||||
void sortChildren(const std::function<bool(const TreeItem *, const TreeItem *)> &cmp);
|
void sortChildren(const std::function<bool(const TreeItem *, const TreeItem *)> &cmp);
|
||||||
void update();
|
void update();
|
||||||
|
Reference in New Issue
Block a user