mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
This changes removes classes of the obsolete logging frame work and all its references. It was not used anywhere, but included in several headers. Had to add header QDateTime in some places, which was not correctly included and now missing. refs #90
53 lines
1.5 KiB
C++
53 lines
1.5 KiB
C++
#include "blackcore/pluginmgr.h"
|
|
#include "blackmisc/plugins.h"
|
|
#include "blackmisc/context.h"
|
|
#include <QCoreApplication>
|
|
#include <iostream>
|
|
#include <vector>
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QCoreApplication a(argc, argv);
|
|
|
|
BlackMisc::CApplicationContext ctx;
|
|
BlackMisc::IContext::setInstance(ctx);
|
|
|
|
{
|
|
const QString pluginPath = "../../build/bin";
|
|
|
|
std::cout << "Loading plugins from " << pluginPath.toStdString() << std::endl;
|
|
|
|
BlackCore::CPluginManager pluginmgr;
|
|
pluginmgr.loadAllPlugins(pluginPath);
|
|
size_t count = pluginmgr.getPluginCount();
|
|
|
|
std::cout << count << " plugins loaded" << std::endl << std::endl;
|
|
|
|
for (size_t i = 0; i < count; ++i)
|
|
{
|
|
std::cout << "Plugin " << i << ": " << pluginmgr.getName(i).toStdString()
|
|
<< ": " << pluginmgr.getDescription(i).toStdString() << std::endl;
|
|
}
|
|
std::cout << std::endl;
|
|
|
|
std::vector<BlackMisc::IPlugin*> plugins;
|
|
|
|
for (size_t i = 0; i < count; ++i)
|
|
{
|
|
std::cout << "Constructing plugin " << i << std::endl;
|
|
|
|
plugins.push_back(pluginmgr.constructPlugin(i));
|
|
}
|
|
|
|
size_t i = 0;
|
|
for (std::vector<BlackMisc::IPlugin*>::iterator it = plugins.begin(); it != plugins.end(); ++it, ++i)
|
|
{
|
|
std::cout << "Destroying plugin " << i << std::endl;
|
|
|
|
(*it)->getFactory().destroy(*it);
|
|
}
|
|
}
|
|
|
|
//return a.exec();
|
|
}
|