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 <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-07-09 08:43:49 -03:00 committed by Dirk Hohndel
parent dbc33cb81a
commit 6480a91756

View file

@ -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()