From fa4fedbb488eacff72d5d8691b4da8b34634a71e Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 14 Mar 2019 22:07:48 +0100 Subject: Undo: implement undo of dive site location editing Simply copy the code of note editing. It's a bit more complex, since we have to parse the Gps coordinates. For consitency, rename the COORD field to LOCATION (the field in the dive_site struct is called LOCATION). Signed-off-by: Berthold Stoeger --- qt-models/divelocationmodel.cpp | 2 +- qt-models/divelocationmodel.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-models') diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp index 89f6dd764..c18f85932 100644 --- a/qt-models/divelocationmodel.cpp +++ b/qt-models/divelocationmodel.cpp @@ -92,7 +92,7 @@ QVariant LocationInformationModel::getDiveSiteData(const struct dive_site *ds, i case DIVESITE: return QVariant::fromValue((dive_site *)ds); // Not nice: casting away const case NAME: return ds->name; case NUM_DIVES: return ds->dives.nr; - case COORDS: return "TODO"; + case LOCATION: return "TODO"; case DESCRIPTION: return ds->description; case NOTES: return ds->name; case TAXONOMY: return "TODO"; diff --git a/qt-models/divelocationmodel.h b/qt-models/divelocationmodel.h index 881c376c8..60c5c993a 100644 --- a/qt-models/divelocationmodel.h +++ b/qt-models/divelocationmodel.h @@ -17,7 +17,7 @@ class LocationInformationModel : public QAbstractTableModel { public: // Common columns, roles and accessor function for all dive-site models. // Thus, different views can connect to different models. - enum Columns { REMOVE, NAME, DESCRIPTION, NUM_DIVES, COORDS, NOTES, DIVESITE, TAXONOMY, COLUMNS}; + enum Columns { REMOVE, NAME, DESCRIPTION, NUM_DIVES, LOCATION, NOTES, DIVESITE, TAXONOMY, COLUMNS}; enum Roles { DIVESITE_ROLE = Qt::UserRole + 1 }; static QVariant getDiveSiteData(const struct dive_site *ds, int column, int role); -- cgit v1.2.3-70-g09d2