[Companion] Crash fixed
This commit is contained in:
@@ -207,11 +207,13 @@ QModelIndex TreeModel::parent(const QModelIndex & index) const
|
|||||||
bool TreeModel::removeRows(int position, int rows, const QModelIndex & parent)
|
bool TreeModel::removeRows(int position, int rows, const QModelIndex & parent)
|
||||||
{
|
{
|
||||||
TreeItem * parentItem = getItem(parent);
|
TreeItem * parentItem = getItem(parent);
|
||||||
bool success;
|
bool success = true;
|
||||||
|
|
||||||
beginRemoveRows(parent, position, position + rows - 1);
|
if (position >= 0 && rows > 0) {
|
||||||
success = parentItem->removeChildren(position, rows);
|
beginRemoveRows(parent, position, position + rows - 1);
|
||||||
endRemoveRows();
|
success = parentItem->removeChildren(position, rows);
|
||||||
|
endRemoveRows();
|
||||||
|
}
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user