From 6480a917563e15352f435fc01a1cc93983575563 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 9 Jul 2014 08:43:49 -0300 Subject: [PATCH] Put a copy of the tags in the displayed dive upon save. I don't think this is the right approach, but it makes things work. The reason that it was not working before it's because upon save we are not copying the edited dive against the displayed dive for some reason, and I didn't find the place that should deal with that. This fixes one of the various issues around tags, but others remain. Fixes #587 Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 524966093..a55ddfd31 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -974,6 +974,9 @@ void MainTab::on_timeEdit_timeChanged(const QTime &time) void MainTab::saveTags() { struct dive *cd = current_dive; + Q_FOREACH(const QString& tag, ui.tagWidget->getBlockStringList()){ + taglist_add_tag(&displayed_dive.tag_list, tag.toUtf8().data()); + } MODIFY_SELECTED_DIVES( QString tag; taglist_free(mydive->tag_list); @@ -981,7 +984,6 @@ void MainTab::saveTags() Q_FOREACH (tag, ui.tagWidget->getBlockStringList()) taglist_add_tag(&mydive->tag_list, tag.toUtf8().data()); ); - qDebug() << "Save tags called"; } void MainTab::on_tagWidget_textChanged()