summaryrefslogtreecommitdiffstats
path: root/qt-ui/modeldelegates.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-14 11:44:40 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-14 11:53:05 -0700
commit44510f990bea4168827764c9ac85488995a59b97 (patch)
tree4f4344a9b2082dd75dbf259ecba27bbc1a553b77 /qt-ui/modeldelegates.cpp
parent8c0d0de2e62356e1bbdad97843d185a37973c5c7 (diff)
downloadsubsurface-44510f990bea4168827764c9ac85488995a59b97.tar.gz
Location completer: show taxonomy according to preferences
The user has picked their preferences of which taxonomy data they want to see. Show them what they asked for. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/modeldelegates.cpp')
-rw-r--r--qt-ui/modeldelegates.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp
index 3e4c860df..516ada3ce 100644
--- a/qt-ui/modeldelegates.cpp
+++ b/qt-ui/modeldelegates.cpp
@@ -503,12 +503,15 @@ void LocationFilterDelegate::paint(QPainter *painter, const QStyleOptionViewItem
return;
QString bottomText;
- for (int i = 0; i < ds->taxonomy.nr; i++) {
- if(ds->taxonomy.category[i].category == TC_NONE)
+ for (int i = 0; i < 3; i++) {
+ if (prefs.geocoding.category[i] == TC_NONE)
+ continue;
+ int idx = taxonomy_index_for_category(&ds->taxonomy, prefs.geocoding.category[i]);
+ if (idx == -1)
continue;
if(!bottomText.isEmpty())
- bottomText += " ";
- bottomText += QString(ds->taxonomy.category[i].value) + " ";
+ bottomText += " / ";
+ bottomText += QString(ds->taxonomy.category[idx].value);
}
if (bottomText.isEmpty()) {