File indexing completed on 2024-06-23 05:07:23

0001 /*
0002     SPDX-FileCopyrightText: 2008 Tobias Koenig <tokoe@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "itemserializerplugin.h"
0008 #include "pluginloader_p.h"
0009 
0010 #include <QApplication>
0011 #include <QDebug>
0012 #include <QStringList>
0013 
0014 using namespace Akonadi;
0015 
0016 int main()
0017 {
0018     QApplication::setApplicationName(QStringLiteral("pluginloadertest"));
0019 
0020     PluginLoader *loader = PluginLoader::self();
0021 
0022     const QStringList types = loader->names();
0023     qDebug("Types:");
0024     for (int i = 0; i < types.count(); ++i) {
0025         qDebug("%s", qPrintable(types.at(i)));
0026     }
0027 
0028     QObject *object = loader->createForName(QStringLiteral("text/vcard@KContacts::Addressee"));
0029     if (qobject_cast<ItemSerializerPlugin *>(object) != nullptr) {
0030         qDebug("Loaded plugin for mimetype 'text/vcard@KContacts::Addressee' successfully");
0031     } else {
0032         qDebug("Unable to load plugin for mimetype 'text/vcard'");
0033     }
0034 
0035     return 0;
0036 }