Changeset 02e768a in subsurface


Ignore:
Timestamp:
Apr 21, 2017, 11:26:49 AM (5 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
bea1217
Parents:
441cfb3
git-author:
Stefan Fuchs <sfuchs@…> (04/21/17 10:46:13)
git-committer:
Dirk Hohndel <dirk@…> (04/21/17 11:26:49)
Message:

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@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • desktop-widgets/downloadfromdivecomputer.cpp

    r597539c r02e768a  
    734734{
    735735        Q_ASSERT(last >= first);
    736         beginRemoveRows(QModelIndex(), 0, lastIndex - firstIndex);
    737         endRemoveRows();
     736        if (lastIndex >= firstIndex) {
     737                beginRemoveRows(QModelIndex(), 0, lastIndex - firstIndex);
     738                endRemoveRows();
     739        }
    738740        beginInsertRows(QModelIndex(), 0, last - first);
    739741        lastIndex = last;
Note: See TracChangeset for help on using the changeset viewer.