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:
parent
c5f52812e1
commit
63a63a807a
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user