mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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@xs4all.nl>
This commit is contained in:
parent
7451517e4a
commit
dbcf044b93
1 changed files with 4 additions and 2 deletions
|
@ -108,8 +108,10 @@ void DivePictureModel::updateDivePictures()
|
|||
|
||||
updateThumbnails();
|
||||
|
||||
beginInsertRows(QModelIndex(), 0, pictures.count() - 1);
|
||||
endInsertRows();
|
||||
if (!pictures.isEmpty()) {
|
||||
beginInsertRows(QModelIndex(), 0, pictures.count() - 1);
|
||||
endInsertRows();
|
||||
}
|
||||
}
|
||||
|
||||
int DivePictureModel::columnCount(const QModelIndex &parent) const
|
||||
|
|
Loading…
Reference in a new issue