mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
After DC import don't do RemoveRows if there is nothing to remove
This fixes an issue where beginRemoveRows is called with argument -1 in DiveImportedModel::setImportedDivesIndexes. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
441cfb3f05
commit
02e768a61b
1 changed files with 4 additions and 2 deletions
|
@ -733,8 +733,10 @@ void DiveImportedModel::clearTable()
|
||||||
void DiveImportedModel::setImportedDivesIndexes(int first, int last)
|
void DiveImportedModel::setImportedDivesIndexes(int first, int last)
|
||||||
{
|
{
|
||||||
Q_ASSERT(last >= first);
|
Q_ASSERT(last >= first);
|
||||||
beginRemoveRows(QModelIndex(), 0, lastIndex - firstIndex);
|
if (lastIndex >= firstIndex) {
|
||||||
endRemoveRows();
|
beginRemoveRows(QModelIndex(), 0, lastIndex - firstIndex);
|
||||||
|
endRemoveRows();
|
||||||
|
}
|
||||||
beginInsertRows(QModelIndex(), 0, last - first);
|
beginInsertRows(QModelIndex(), 0, last - first);
|
||||||
lastIndex = last;
|
lastIndex = last;
|
||||||
firstIndex = first;
|
firstIndex = first;
|
||||||
|
|
Loading…
Add table
Reference in a new issue