Commit 6e0b4d4e authored by David Faure's avatar David Faure
Browse files

Fix assert from QAbstractItemModel when clearing an empty view

parent 29ca8365
......@@ -164,9 +164,11 @@ bool KFindItemModel::isInserted(const QUrl &url)
void KFindItemModel::clear()
{
beginRemoveRows(QModelIndex(), 0, m_itemList.size());
m_itemList.clear();
endRemoveRows();
if (!m_itemList.isEmpty()) {
beginRemoveRows(QModelIndex(), 0, m_itemList.size());
m_itemList.clear();
endRemoveRows();
}
}
Qt::ItemFlags KFindItemModel::flags(const QModelIndex &index) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment