akonadi
23 #include "agentfactory.h"
24 #include "servermanager.h"
25 #include "servermanager_p.h"
29 #include <QtCore/QThread>
30 #include <QtCore/QThreadStorage>
32 QThreadStorage<KComponentData*> s_agentComponentDatas;
34 using namespace Akonadi;
36 class Akonadi::AgentFactoryBasePrivate
43 : QObject( parent ), d( new AgentFactoryBasePrivate )
45 d->catalogName = QString::fromLatin1( catalogName );
46 if ( !KGlobal::hasMainComponent() )
47 new KComponentData(
"AkonadiAgentServer",
"libakonadi", KComponentData::RegisterAsMainComponent );
49 KGlobal::locale()->insertCatalog( d->catalogName );
51 Internal::setClientType( Internal::Agent );
55 AgentFactoryBase::~AgentFactoryBase()
60 void AgentFactoryBase::createComponentData(
const QString& identifier )
const
62 Q_ASSERT( !s_agentComponentDatas.hasLocalData() );
64 if ( QThread::currentThread() != QCoreApplication::instance()->thread() ) {
65 s_agentComponentDatas.setLocalData(
new KComponentData( identifier.toLatin1(), d->catalogName.toLatin1(),
66 KComponentData::SkipMainComponentRegistration ) );
68 s_agentComponentDatas.setLocalData(
new KComponentData( identifier.toLatin1(), d->catalogName.toLatin1() ) );
72 #include "agentfactory.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Dec 10 2012 13:48:07 by
doxygen 1.8.1.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.