summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-11-14 17:42:59 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-11-14 10:01:50 -0800
commit38a784f5af3e19936df29e93b70a66e3741f8ea8 (patch)
tree2a6832759936eb91497d99457d8bae8c01db00a5 /desktop-widgets/tab-widgets
parent52d5125926f430a86dc14a60911b04b8072c712a (diff)
downloadsubsurface-38a784f5af3e19936df29e93b70a66e3741f8ea8.tar.gz
desktop: automatically reload completion-models
Instead of programatically reload the completion models, listen to the relevant signals in the models. To that goal, derive all the models from a base class. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r--desktop-widgets/tab-widgets/TabDiveEquipment.cpp1
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp15
2 files changed, 3 insertions, 13 deletions
diff --git a/desktop-widgets/tab-widgets/TabDiveEquipment.cpp b/desktop-widgets/tab-widgets/TabDiveEquipment.cpp
index 8a7fc63b5..5105029a3 100644
--- a/desktop-widgets/tab-widgets/TabDiveEquipment.cpp
+++ b/desktop-widgets/tab-widgets/TabDiveEquipment.cpp
@@ -127,7 +127,6 @@ void TabDiveEquipment::updateData()
{
cylindersModel->updateDive(current_dive);
weightModel->updateDive(current_dive);
- suitModel.updateModel();
ui.cylinders->view()->hideColumn(CylindersModel::DEPTH);
bool is_ccr = current_dive && get_dive_dc(current_dive, dc_number)->divemode == CCR;
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index 30c768c25..f519d6a0b 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -261,18 +261,12 @@ void MainTab::divesChanged(const QVector<dive *> &dives, DiveField field)
}
if (field.divesite)
updateDiveSite(current_dive);
- if (field.tags) {
- tagModel.updateModel(); // TODO: Don't do this here
+ if (field.tags)
ui.tagWidget->setText(get_taglist_string(current_dive->tag_list));
- }
- if (field.buddy) {
- buddyModel.updateModel(); // TODO: Don't do this here
+ if (field.buddy)
ui.buddy->setText(current_dive->buddy);
- }
- if (field.divemaster) {
- diveMasterModel.updateModel(); // TODO: Don't do this here
+ if (field.divemaster)
ui.divemaster->setText(current_dive->divemaster);
- }
// If duration or depth changed, the profile needs to be replotted
if (field.duration || field.depth)
@@ -499,9 +493,6 @@ void MainTab::updateDiveInfo()
void MainTab::reload()
{
- buddyModel.updateModel();
- diveMasterModel.updateModel();
- tagModel.updateModel();
}
void MainTab::refreshDisplayedDiveSite()