summaryrefslogtreecommitdiffstats
path: root/qt-ui/maintab.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-07-09 08:43:49 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-09 08:53:06 -0700
commit6480a917563e15352f435fc01a1cc93983575563 (patch)
tree91a45d655e979230811798a1397c4b15b4ae388c /qt-ui/maintab.cpp
parentdbc33cb81a606146f609ba2f8699c6a4c13fe4ce (diff)
downloadsubsurface-6480a917563e15352f435fc01a1cc93983575563.tar.gz
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>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r--qt-ui/maintab.cpp4
1 files changed, 3 insertions, 1 deletions
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()