diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-10-21 23:10:08 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-10-25 13:59:04 -0700 |
commit | c6188bbe47469d72bcb9afba69eb27fb39646cc1 (patch) | |
tree | 6d33cfcefedda699f396fe42f903321ec7a7ddab /qt-models/divecomputermodel.h | |
parent | 4467477389cf0d6de8e3797b1941c07162896907 (diff) | |
download | subsurface-c6188bbe47469d72bcb9afba69eb27fb39646cc1.tar.gz |
devices: connect DiveComputerModel to undo-command
Instead of modifying the device table directly, call the undo
commands. Moreover, don't keep our own copy in the mode - show
the original version. Connect to the appropriate signals.
This means that the calls from the DiveComputerManagement
dialog have to be removed, since this mode of editing is
not supported. The whole dialog will be removed in a future
commit.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divecomputermodel.h')
-rw-r--r-- | qt-models/divecomputermodel.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/qt-models/divecomputermodel.h b/qt-models/divecomputermodel.h index 17f145f78..a68542ff1 100644 --- a/qt-models/divecomputermodel.h +++ b/qt-models/divecomputermodel.h @@ -20,15 +20,14 @@ public: int rowCount(const QModelIndex &parent = QModelIndex()) const override; Qt::ItemFlags flags(const QModelIndex &index) const override; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; - void keepWorkingList(); -public +private slots: void remove(const QModelIndex &index); void update(); - -private: - std::vector<device> dcs; + void deviceAdded(int idx); + void deviceDeleted(int idx); + void deviceEdited(int idx); }; class DiveComputerSortedModel : public QSortFilterProxyModel { |