akonadi
22 #include "improtocols.h"
24 #include <kiconloader.h>
25 #include <kservicetypetrader.h>
27 IMProtocols* IMProtocols::mSelf = 0;
29 IMProtocols::IMProtocols()
31 KIconLoader::global()->addAppDir( QLatin1String(
"akonadi/contact" ) );
33 const QList<KPluginInfo> list = KPluginInfo::fromServices( KServiceTypeTrader::self()->query( QString::fromLatin1(
"KABC/IMProtocol" ) ) );
36 QMap<QString, KPluginInfo> sortingMap;
37 foreach (
const KPluginInfo &info, list ) {
38 sortingMap.insert( info.name(), info );
40 mPluginInfos.insert( info.property( QLatin1String(
"X-KDE-InstantMessagingKABCField" ) ).toString(), info );
43 QMapIterator<QString, KPluginInfo> it( sortingMap );
44 while ( it.hasNext() ) {
46 mSortedProtocols.append( it.value().property( QLatin1String(
"X-KDE-InstantMessagingKABCField" ) ).toString() );
50 IMProtocols::~IMProtocols()
54 IMProtocols* IMProtocols::self()
57 mSelf =
new IMProtocols;
63 QStringList IMProtocols::protocols()
const
65 return mSortedProtocols;
68 QString IMProtocols::name(
const QString &protocol )
const
70 if ( !mPluginInfos.contains( protocol ) ) {
74 return mPluginInfos.value( protocol ).name();
77 QString IMProtocols::icon(
const QString &protocol )
const
79 if ( !mPluginInfos.contains( protocol ) ) {
83 return mPluginInfos.value( protocol ).icon();
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:27 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.