From 828e2f0b57e45065d123ad85e4792f6efab5a4d8 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Fri, 27 Nov 2009 15:20:07 +0000 Subject: [PATCH] Kill most of the evil code in KabcBridge and port the category search/filter widget to Nepomuk tags instead. Massive speed-up when opening the search window in KMail. svn path=/branches/work/akonadi-ports/kdepim/; revision=1055205 --- rulewidgethandlermanager.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rulewidgethandlermanager.cpp b/rulewidgethandlermanager.cpp index 98c368612..68c01debc 100644 --- a/rulewidgethandlermanager.cpp +++ b/rulewidgethandlermanager.cpp @@ -36,6 +36,8 @@ #include "interfaces/rulewidgethandler.h" #include "messageviewer/stl_util.h" +#include + #include #include @@ -375,7 +377,6 @@ void KMail::RuleWidgetHandlerManager::update( const QByteArray &field, // these includes are temporary and should not be needed for the code // above this line, so they appear only here: -#include "messageviewer/kmaddrbook.h" #include "kmsearchpattern.h" #include "regexplineedit.h" using KMail::RegExpLineEdit; @@ -461,8 +462,12 @@ namespace { if ( number == 2 ) { KComboBox *combo = new KComboBox( valueStack ); combo->setObjectName( "categoryCombo" ); - QStringList categories = KabcBridge::categories(); - combo->addItems( categories ); + foreach ( const Nepomuk::Tag &tag, Nepomuk::Tag::allTags() ) { + if ( tag.genericIcon().isEmpty() ) + combo->addItem( tag.label(), tag.resourceUri() ); + else + combo->addItem( KIcon( tag.genericIcon() ), tag.label(), tag.resourceUri() ); + } QObject::connect( combo, SIGNAL( activated( int ) ), receiver, SLOT( slotValueChanged() ) ); return combo;