Notes pane: don't show empty taxonomy tags

No point in searching for the right tag if the user picked no taxonomy to
be shown. And no point in showing an empty value, either.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-07-02 10:23:16 -07:00
parent bc8c54f1ee
commit 898d82e647

View file

@ -515,10 +515,15 @@ void MainTab::updateDiveInfo(bool clear)
locationTag = "<small><small>(tags: ";
QString connector = "";
for (int i = 0; i < 3; i++) {
if (prefs.geocoding.category[i] == TC_NONE)
continue;
for (int j = 0; j < TC_NR_CATEGORIES; j++) {
if (ds->taxonomy.category[j].category == prefs.geocoding.category[i]) {
locationTag += connector + QString(ds->taxonomy.category[j].value);
connector = " / ";
QString tag = ds->taxonomy.category[j].value;
if (!tag.isEmpty()) {
locationTag += connector + tag;
connector = " / ";
}
break;
}
}