summaryrefslogtreecommitdiffstats
path: root/qt-models/divepicturemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models/divepicturemodel.cpp')
-rw-r--r--qt-models/divepicturemodel.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/qt-models/divepicturemodel.cpp b/qt-models/divepicturemodel.cpp
index 2fc7b8311..9b993cb5a 100644
--- a/qt-models/divepicturemodel.cpp
+++ b/qt-models/divepicturemodel.cpp
@@ -57,10 +57,9 @@ void DivePictureModel::updateThumbnails()
void DivePictureModel::updateDivePictures()
{
+ beginResetModel();
if (!pictures.isEmpty()) {
- beginRemoveRows(QModelIndex(), 0, pictures.count() - 1);
pictures.clear();
- endRemoveRows();
rowDDStart = rowDDEnd = 0;
Thumbnailer::instance()->clearWorkQueue();
}
@@ -83,11 +82,7 @@ void DivePictureModel::updateDivePictures()
}
updateThumbnails();
-
- if (!pictures.isEmpty()) {
- beginInsertRows(QModelIndex(), 0, pictures.count() - 1);
- endInsertRows();
- }
+ endResetModel();
}
int DivePictureModel::columnCount(const QModelIndex &parent) const