summaryrefslogtreecommitdiffstats
path: root/qt-models/divetripmodel.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-19 19:04:56 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-05-06 13:58:09 -0700
commitd62e60277c6fa5f7b8bc612bd1c6accd3f6d0044 (patch)
tree82fece1f31fb559fd016ad2dcfebd85c96ca6347 /qt-models/divetripmodel.cpp
parent4374605c1295ede804d1ae1355094f8a3e0429e9 (diff)
downloadsubsurface-d62e60277c6fa5f7b8bc612bd1c6accd3f6d0044.tar.gz
dive list: update dive list entry if pictures changed
We show an icon whether there are pictures and whether they are before or after the dive. Thus, the list models must emit the proper signals when the pictures of a dive change. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divetripmodel.cpp')
-rw-r--r--qt-models/divetripmodel.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp
index 73402cdad..ed5542fcc 100644
--- a/qt-models/divetripmodel.cpp
+++ b/qt-models/divetripmodel.cpp
@@ -715,9 +715,12 @@ DiveTripModelTree::DiveTripModelTree(QObject *parent) : DiveTripModelBase(parent
connect(&diveListNotifier, &DiveListNotifier::divesSelected, this, &DiveTripModelTree::divesSelected);
connect(&diveListNotifier, &DiveListNotifier::tripChanged, this, &DiveTripModelTree::tripChanged);
connect(&diveListNotifier, &DiveListNotifier::filterReset, this, &DiveTripModelTree::filterReset);
- connect(&diveListNotifier, &DiveListNotifier::cylinderAdded, this, &DiveTripModelTree::cylinderChanged);
- connect(&diveListNotifier, &DiveListNotifier::cylinderEdited, this, &DiveTripModelTree::cylinderChanged);
- connect(&diveListNotifier, &DiveListNotifier::cylinderRemoved, this, &DiveTripModelTree::cylinderChanged);
+ connect(&diveListNotifier, &DiveListNotifier::cylinderAdded, this, &DiveTripModelTree::diveChanged);
+ connect(&diveListNotifier, &DiveListNotifier::cylinderEdited, this, &DiveTripModelTree::diveChanged);
+ connect(&diveListNotifier, &DiveListNotifier::cylinderRemoved, this, &DiveTripModelTree::diveChanged);
+ connect(&diveListNotifier, &DiveListNotifier::pictureOffsetChanged, this, &DiveTripModelTree::diveChanged);
+ connect(&diveListNotifier, &DiveListNotifier::picturesRemoved, this, &DiveTripModelTree::diveChanged);
+ connect(&diveListNotifier, &DiveListNotifier::picturesAdded, this, &DiveTripModelTree::diveChanged);
populate();
}
@@ -1255,7 +1258,7 @@ void DiveTripModelTree::divesChanged(const QVector<dive *> &dives)
{ divesChangedTrip(trip, divesInTrip); });
}
-void DiveTripModelTree::cylinderChanged(dive *d)
+void DiveTripModelTree::diveChanged(dive *d)
{
divesChanged(QVector<dive *> { d });
}
@@ -1476,9 +1479,12 @@ DiveTripModelList::DiveTripModelList(QObject *parent) : DiveTripModelBase(parent
connect(&diveListNotifier, &DiveListNotifier::divesTimeChanged, this, &DiveTripModelList::divesTimeChanged);
connect(&diveListNotifier, &DiveListNotifier::divesSelected, this, &DiveTripModelList::divesSelected);
connect(&diveListNotifier, &DiveListNotifier::filterReset, this, &DiveTripModelList::filterReset);
- connect(&diveListNotifier, &DiveListNotifier::cylinderAdded, this, &DiveTripModelList::cylinderChanged);
- connect(&diveListNotifier, &DiveListNotifier::cylinderEdited, this, &DiveTripModelList::cylinderChanged);
- connect(&diveListNotifier, &DiveListNotifier::cylinderRemoved, this, &DiveTripModelList::cylinderChanged);
+ connect(&diveListNotifier, &DiveListNotifier::cylinderAdded, this, &DiveTripModelList::diveChanged);
+ connect(&diveListNotifier, &DiveListNotifier::cylinderEdited, this, &DiveTripModelList::diveChanged);
+ connect(&diveListNotifier, &DiveListNotifier::cylinderRemoved, this, &DiveTripModelList::diveChanged);
+ connect(&diveListNotifier, &DiveListNotifier::pictureOffsetChanged, this, &DiveTripModelList::diveChanged);
+ connect(&diveListNotifier, &DiveListNotifier::picturesRemoved, this, &DiveTripModelList::diveChanged);
+ connect(&diveListNotifier, &DiveListNotifier::picturesAdded, this, &DiveTripModelList::diveChanged);
populate();
}
@@ -1632,7 +1638,7 @@ void DiveTripModelList::divesChanged(const QVector<dive *> &divesIn)
initSelection();
}
-void DiveTripModelList::cylinderChanged(dive *d)
+void DiveTripModelList::diveChanged(dive *d)
{
divesChanged(QVector<dive *> { d });
}