mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 09:45:40 +00:00
Don't inform about a nested row addition in proxy models for top-level tables
This commit is contained in:
parent
6a82ce0d50
commit
3280aade39
2 changed files with 14 additions and 7 deletions
|
@ -112,10 +112,13 @@ void CSMWorld::IdTableProxyModel::refreshFilter()
|
||||||
invalidateFilter();
|
invalidateFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMWorld::IdTableProxyModel::sourceRowsInserted(const QModelIndex &/*parent*/, int /*start*/, int end)
|
void CSMWorld::IdTableProxyModel::sourceRowsInserted(const QModelIndex &parent, int /*start*/, int end)
|
||||||
{
|
{
|
||||||
refreshFilter();
|
refreshFilter();
|
||||||
|
if (!parent.isValid())
|
||||||
|
{
|
||||||
emit rowAdded(getRecordId(end).toUtf8().constData());
|
emit rowAdded(getRecordId(end).toUtf8().constData());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMWorld::IdTableProxyModel::sourceRowsRemoved(const QModelIndex &/*parent*/, int /*start*/, int /*end*/)
|
void CSMWorld::IdTableProxyModel::sourceRowsRemoved(const QModelIndex &/*parent*/, int /*start*/, int /*end*/)
|
||||||
|
|
|
@ -77,13 +77,17 @@ void CSMWorld::InfoTableProxyModel::sourceRowsRemoved(const QModelIndex &/*paren
|
||||||
mFirstRowCache.clear();
|
mFirstRowCache.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMWorld::InfoTableProxyModel::sourceRowsInserted(const QModelIndex &/*parent*/, int /*start*/, int end)
|
void CSMWorld::InfoTableProxyModel::sourceRowsInserted(const QModelIndex &parent, int /*start*/, int end)
|
||||||
{
|
{
|
||||||
refreshFilter();
|
refreshFilter();
|
||||||
|
|
||||||
|
if (!parent.isValid())
|
||||||
|
{
|
||||||
mFirstRowCache.clear();
|
mFirstRowCache.clear();
|
||||||
// We can't re-sort the model here, because the topic of the added row isn't set yet.
|
// We can't re-sort the model here, because the topic of the added row isn't set yet.
|
||||||
// Store the row index for using in the first dataChanged() after this row insertion.
|
// Store the row index for using in the first dataChanged() after this row insertion.
|
||||||
mLastAddedSourceRow = end;
|
mLastAddedSourceRow = end;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMWorld::InfoTableProxyModel::sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
|
void CSMWorld::InfoTableProxyModel::sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
|
||||||
|
|
Loading…
Reference in a new issue