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) ...@@ -164,9 +164,11 @@ bool KFindItemModel::isInserted(const QUrl &url)
void KFindItemModel::clear() void KFindItemModel::clear()
{ {
if (!m_itemList.isEmpty()) {
beginRemoveRows(QModelIndex(), 0, m_itemList.size()); beginRemoveRows(QModelIndex(), 0, m_itemList.size());
m_itemList.clear(); m_itemList.clear();
endRemoveRows(); endRemoveRows();
}
} }
Qt::ItemFlags KFindItemModel::flags(const QModelIndex &index) const Qt::ItemFlags KFindItemModel::flags(const QModelIndex &index) const
......
Supports Markdown
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