summaryrefslogtreecommitdiffstats
path: root/qt-models/divelocationmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models/divelocationmodel.cpp')
-rw-r--r--qt-models/divelocationmodel.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp
index b01ae03b6..fbeab7be8 100644
--- a/qt-models/divelocationmodel.cpp
+++ b/qt-models/divelocationmodel.cpp
@@ -27,6 +27,7 @@ LocationInformationModel::LocationInformationModel(QObject *obj) : QAbstractTabl
connect(&diveListNotifier, &DiveListNotifier::diveSiteAdded, this, &LocationInformationModel::diveSiteAdded);
connect(&diveListNotifier, &DiveListNotifier::diveSiteDeleted, this, &LocationInformationModel::diveSiteDeleted);
connect(&diveListNotifier, &DiveListNotifier::diveSiteChanged, this, &LocationInformationModel::diveSiteChanged);
+ connect(&diveListNotifier, &DiveListNotifier::diveSiteDivesChanged, this, &LocationInformationModel::diveSiteDivesChanged);
}
int LocationInformationModel::columnCount(const QModelIndex &) const
@@ -167,6 +168,14 @@ void LocationInformationModel::diveSiteChanged(struct dive_site *ds, int field)
dataChanged(createIndex(idx, field), createIndex(idx, field));
}
+void LocationInformationModel::diveSiteDivesChanged(struct dive_site *ds)
+{
+ int idx = get_divesite_idx(ds, &dive_site_table);
+ if (idx < 0)
+ return;
+ dataChanged(createIndex(idx, NUM_DIVES), createIndex(idx, NUM_DIVES));
+}
+
bool DiveSiteSortedModel::filterAcceptsRow(int sourceRow, const QModelIndex &source_parent) const
{
// TODO: filtering