aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-11-12 17:13:48 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-11-12 11:22:12 -0800
commitb390fb368dabfeeb9bc1b800bc7a56b5963c9b94 (patch)
tree88f5e04307227fd602c3d9f708bbd45c5f5003da /desktop-widgets/tab-widgets
parent0272f118aeff4b9e7e5c08edcc664e9a9ab26368 (diff)
downloadsubsurface-b390fb368dabfeeb9bc1b800bc7a56b5963c9b94.tar.gz
desktop: update completion models if dive was edited
In the main-tab, when changing tag, buddy or divemaster, update the corresponding completion model. This is a quick-fix and the wrong thing to do. It works only if the currently shown dive is changed, which is not a given. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index 7c4d40011..30c768c25 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -261,12 +261,18 @@ void MainTab::divesChanged(const QVector<dive *> &dives, DiveField field)
}
if (field.divesite)
updateDiveSite(current_dive);
- if (field.tags)
+ if (field.tags) {
+ tagModel.updateModel(); // TODO: Don't do this here
ui.tagWidget->setText(get_taglist_string(current_dive->tag_list));
- if (field.buddy)
+ }
+ if (field.buddy) {
+ buddyModel.updateModel(); // TODO: Don't do this here
ui.buddy->setText(current_dive->buddy);
- if (field.divemaster)
+ }
+ if (field.divemaster) {
+ diveMasterModel.updateModel(); // TODO: Don't do this here
ui.divemaster->setText(current_dive->divemaster);
+ }
// If duration or depth changed, the profile needs to be replotted
if (field.duration || field.depth)