Undo: keep frontend informed of changes to dive site count

Add a new signal to DiveListNotifier. Send signal if dives are
added or removed and therefore the dive count of a dive site
changes. The dive sites are collected and the signal is sent
at the end of the command.

Add code to update the table view.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-03-10 16:03:39 +01:00 committed by Dirk Hohndel
parent dd12bdaf94
commit 8dcc33d8ab
6 changed files with 37 additions and 2 deletions

View file

@ -9,6 +9,9 @@
#define RECENTLY_ADDED_DIVESITE ((struct dive_site *)~0)
struct dive;
struct dive_trip;
class LocationInformationModel : public QAbstractTableModel {
Q_OBJECT
public:
@ -30,6 +33,7 @@ public:
public slots:
void update();
QStringList allSiteNames() const;
void diveSiteDiveCountChanged(struct dive_site *ds);
private:
QStringList locationNames;
};