Changeset dbcf044 in subsurface


Ignore:
Timestamp:
Dec 24, 2017, 8:25:21 AM (4 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
734bd6d
Parents:
7451517e
git-author:
Jan Mulder <jlmulder@…> (12/24/17 05:28:04)
git-committer:
Dirk Hohndel <dirk@…> (12/24/17 08:25:21)
Message:

beginInsertRows requires last >= first

Found while compiled against Qt 5.10 build from source. The assert
Q_ASSERT(last >= first) is trapped by this beginInsertRows in
case there are no pictures. Just do not call this when there are
no pictures.

Signed-off-by: Jan Mulder <jlmulder@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qt-models/divepicturemodel.cpp

    r05a1626 rdbcf044  
    109109        updateThumbnails();
    110110
    111         beginInsertRows(QModelIndex(), 0, pictures.count() - 1);
    112         endInsertRows();
     111        if (!pictures.isEmpty()) {
     112                beginInsertRows(QModelIndex(), 0, pictures.count() - 1);
     113                endInsertRows();
     114        }
    113115}
    114116
Note: See TracChangeset for help on using the changeset viewer.