1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-23 00:18:37 -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)); qDebug("PluginManager::loadPluginsDir: fileName: %s", qPrintable(fileName));
QPluginLoader* plugin = new QPluginLoader(pluginsDir.absoluteFilePath(fileName)); QPluginLoader* pluginLoader = new QPluginLoader(pluginsDir.absoluteFilePath(fileName));
if (!plugin->load()) if (!pluginLoader->load())
{ {
qWarning("PluginManager::loadPluginsDir: %s", qPrintable(plugin->errorString())); qWarning("PluginManager::loadPluginsDir: %s", qPrintable(pluginLoader->errorString()));
delete plugin; delete pluginLoader;
continue; continue;
} }
PluginInterface* instance = qobject_cast<PluginInterface*>(plugin->instance()); PluginInterface* instance = qobject_cast<PluginInterface*>(pluginLoader->instance());
if (instance == nullptr) if (instance == nullptr)
{ {
qWarning("PluginManager::loadPluginsDir: Unable to get main instance of plugin: %s", qPrintable(fileName) ); qWarning("PluginManager::loadPluginsDir: Unable to get main instance of plugin: %s", qPrintable(fileName) );
delete plugin; delete pluginLoader;
continue; continue;
} }
qInfo("PluginManager::loadPluginsDir: loaded plugin %s", qPrintable(fileName)); qInfo("PluginManager::loadPluginsDir: loaded plugin %s", qPrintable(fileName));
m_plugins.append(Plugin(fileName, plugin, instance)); m_plugins.append(Plugin(fileName, pluginLoader, instance));
} }
} }
} }