Ok, this fixes the ghost tags bug completely ( all of the three patches ) On Tue, Jul 8, 2014 at 10:44 PM, Tomaz Canabrava <[email protected]> wrote: > Those are correct patches and should be used, there's a problem that I > was unable to solve, tougth ( and I'm not feeling very cody today ) > After a edit is done, the tags will be deleted and repopulated, this > is done in 'saveTag()', the code seems correct and works. > The tags are correctly saved on the dive, but the tags are not > appearing on the information tab unless you have more than one dive on > the list, then desselect and resellect it. > > I tried to walk around the code, and for me it seems like the code > that copies the selected dive to the displayed_dive is not being > called, and I didn't found out why.
From 10cbd1169229236deed21be9254e8c5245017971 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava <[email protected]> Date: Wed, 9 Jul 2014 08:43:49 -0300 Subject: [PATCH 3/3] 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 works. 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 found out the place that should deal with that, Dirk, you changed this a little time ago, can you spare any light? Signed-off-by: Tomaz Canabrava <[email protected]> --- 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 5249660..a55ddfd 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() -- 2.0.1
_______________________________________________ subsurface mailing list [email protected] http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
