From 44510f990bea4168827764c9ac85488995a59b97 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 14 Jul 2015 11:44:40 -0700 Subject: 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 --- qt-ui/modeldelegates.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'qt-ui') 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()) { -- cgit v1.2.3-70-g09d2