summaryrefslogtreecommitdiffstats
path: root/qt-models/divetripmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models/divetripmodel.cpp')
-rw-r--r--qt-models/divetripmodel.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp
index fd8a2f08a..384da6b89 100644
--- a/qt-models/divetripmodel.cpp
+++ b/qt-models/divetripmodel.cpp
@@ -584,10 +584,7 @@ void DiveTripModel::setupModelData()
{
int i = dive_table.nr;
- if (rowCount()) {
- beginRemoveRows(QModelIndex(), 0, rowCount() - 1);
- endRemoveRows();
- }
+ beginResetModel();
if (autogroup)
autogroup_dives();
@@ -621,10 +618,7 @@ void DiveTripModel::setupModelData()
tripItem->children.push_back(diveItem);
}
- if (rowCount()) {
- beginInsertRows(QModelIndex(), 0, rowCount() - 1);
- endInsertRows();
- }
+ endResetModel();
}
DiveTripModel::Layout DiveTripModel::layout() const