fix Warning
This commit is contained in:
1 parent
593c221d23
commit
8345470273
316 files changed
+1246
-929
No files matched your search
@@ -9,6 +9,8 @@
|
||||
*/
|
||||
|
||||
#include "lts_plugin_loader.h"
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include <LtsAppDescriptor/lts_app_descriptor.h>
|
||||
@@ -56,7 +58,7 @@ LtsPluginLoader::~LtsPluginLoader()
|
||||
|
||||
void LtsPluginLoader::unloadAllPlugins()
|
||||
{
|
||||
for (auto &pi : qAsConst(m_loadedPlugins))
|
||||
for (auto &pi : std::as_const(m_loadedPlugins))
|
||||
{
|
||||
QPluginLoader *pluginLoader = pi.pluginLoader;
|
||||
|
||||
@@ -280,7 +282,7 @@ bool LtsPluginLoader::loadPlugins(PluginType requestedPluginType,
|
||||
// continue;
|
||||
// }
|
||||
|
||||
QScopedPointer<QPluginLoader> pluginLoader(new QPluginLoader);
|
||||
std::unique_ptr<QPluginLoader> pluginLoader(new QPluginLoader);
|
||||
pluginLoader->setFileName(absoluteFilePath);
|
||||
|
||||
const QJsonObject jObj = pluginLoader->metaData();
|
||||
@@ -433,7 +435,7 @@ bool LtsPluginLoader::loadPlugins(PluginType requestedPluginType,
|
||||
pi.fileName = filename;
|
||||
pi.fullFileName = absoluteFilePath;
|
||||
pi.plugin = plugin;
|
||||
pi.pluginLoader = pluginLoader.data();
|
||||
pi.pluginLoader = pluginLoader.get();
|
||||
|
||||
if (loadPlugin && !loadPlugin(pi)) // does the dev want this plugin? if no, unload it! TODO: really unload? or still cache it??
|
||||
{
|
||||
@@ -442,7 +444,7 @@ bool LtsPluginLoader::loadPlugins(PluginType requestedPluginType,
|
||||
pluginLoader->unload();
|
||||
continue; // next plugin
|
||||
}
|
||||
pi.pluginLoader = pluginLoader.take();
|
||||
pi.pluginLoader = pluginLoader.release();
|
||||
|
||||
// the dev decided to use that plugin, so cache it
|
||||
m_loadedPlugins.insert(PluginKey(requestedPluginType, pluginName), pi);
|
||||
|
||||
Reference in new issue
Block a user