Add helper functions to ensure we have sane tag lists

There should never be empty or duplicate tags on those lists.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-07-10 09:39:51 -07:00
parent 634df1a337
commit a8a8bcd86a
3 changed files with 29 additions and 2 deletions

View file

@ -934,9 +934,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()){
Q_FOREACH (const QString& tag, ui.tagWidget->getBlockStringList())
taglist_add_tag(&displayed_dive.tag_list, tag.toUtf8().data());
}
taglist_cleanup(&displayed_dive.tag_list);
MODIFY_SELECTED_DIVES(
QString tag;
taglist_free(mydive->tag_list);