1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 16:08:39 -05:00

rework spaces on pluginmanager.cpp

This commit is contained in:
Davide Gerhard 2019-05-18 18:58:35 +02:00
parent c5f52812e1
commit 63a63a807a
No known key found for this signature in database
GPG Key ID: 7CBEFA144857DC97

View File

@ -158,24 +158,24 @@ void PluginManager::loadPluginsDir(const QDir& dir)
{
qDebug("PluginManager::loadPluginsDir: fileName: %s", qPrintable(fileName));
QPluginLoader* plugin = new QPluginLoader(pluginsDir.absoluteFilePath(fileName));
if (!plugin->load())
QPluginLoader* pluginLoader = new QPluginLoader(pluginsDir.absoluteFilePath(fileName));
if (!pluginLoader->load())
{
qWarning("PluginManager::loadPluginsDir: %s", qPrintable(plugin->errorString()));
delete plugin;
qWarning("PluginManager::loadPluginsDir: %s", qPrintable(pluginLoader->errorString()));
delete pluginLoader;
continue;
}
PluginInterface* instance = qobject_cast<PluginInterface*>(plugin->instance());
PluginInterface* instance = qobject_cast<PluginInterface*>(pluginLoader->instance());
if (instance == nullptr)
{
qWarning("PluginManager::loadPluginsDir: Unable to get main instance of plugin: %s", qPrintable(fileName) );
delete plugin;
delete pluginLoader;
continue;
}
qInfo("PluginManager::loadPluginsDir: loaded plugin %s", qPrintable(fileName));
m_plugins.append(Plugin(fileName, plugin, instance));
m_plugins.append(Plugin(fileName, pluginLoader, instance));
}
}
}