1 /*
2  * This file is part of telepathy-accounts-kcm
3  *
4  * Copyright (C) 2011 Lasse Liehu <lliehu@kolumbus.fi>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  */
20 
21 #include "idle-account-ui-plugin.h"
22 
23 #include "idle-account-ui.h"
24 
25 #include <KPluginFactory>
26 
27 #include <QtCore/QVariantList>
28 
IdleAccountUiPlugin(QObject * parent,const QVariantList &)29 IdleAccountUiPlugin::IdleAccountUiPlugin(QObject *parent, const QVariantList &)
30  : AbstractAccountUiPlugin(parent)
31 {
32     // Register supported cm/protocol combinations
33     registerProvidedProtocol(QLatin1String("idle"), QLatin1String("irc"));
34 }
35 
~IdleAccountUiPlugin()36 IdleAccountUiPlugin::~IdleAccountUiPlugin()
37 {
38 }
39 
accountUi(const QString & connectionManager,const QString & protocol,const QString & serviceName)40 AbstractAccountUi* IdleAccountUiPlugin::accountUi(const QString &connectionManager, const QString &protocol, const QString &serviceName)
41 {
42     Q_UNUSED(serviceName);
43 
44     if ((connectionManager == QLatin1String("idle")) && (protocol == QLatin1String("irc"))) {
45         return new IdleAccountUi;
46     }
47 
48     return nullptr;
49 }
50 
51 K_PLUGIN_FACTORY(factory, registerPlugin<IdleAccountUiPlugin>();)
52 
53 #include "idle-account-ui-plugin.moc"
54