diff options
Diffstat (limited to 'qt-models/divecomputermodel.cpp')
-rw-r--r-- | qt-models/divecomputermodel.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/qt-models/divecomputermodel.cpp b/qt-models/divecomputermodel.cpp index 356e24ef8..c51e19279 100644 --- a/qt-models/divecomputermodel.cpp +++ b/qt-models/divecomputermodel.cpp @@ -2,11 +2,21 @@ #include "qt-models/divecomputermodel.h" #include "core/dive.h" #include "core/divelist.h" +#include "core/subsurface-qt/divelistnotifier.h" DiveComputerModel::DiveComputerModel(QObject *parent) : CleanerTableModel(parent), dcs(device_table.devices) { + connect(&diveListNotifier, &DiveListNotifier::dataReset, this, &DiveComputerModel::update); setHeaderDataStrings(QStringList() << "" << tr("Model") << tr("Device ID") << tr("Nickname")); + update(); +} + +void DiveComputerModel::update() +{ + beginResetModel(); + dcs = device_table.devices; + endResetModel(); } QVariant DiveComputerModel::data(const QModelIndex &index, int role) const |