Don't try to load files with wrong extension as native plugins. #2626

This commit is contained in:
Kārlis Seņko 2022-08-11 11:01:56 +03:00 committed by karliss
parent 617c79f976
commit 39bf5c6429

View File

@ -133,6 +133,10 @@ QString PluginManager::getUserPluginsDirectory() const
void PluginManager::loadNativePlugins(const QDir &directory) void PluginManager::loadNativePlugins(const QDir &directory)
{ {
for (const QString &fileName : directory.entryList(QDir::Files)) { for (const QString &fileName : directory.entryList(QDir::Files)) {
if (!QLibrary::isLibrary(fileName)) {
// Reduce amount of warnings, by not attempting files which are obviously not plugins
continue;
}
QPluginLoader pluginLoader(directory.absoluteFilePath(fileName)); QPluginLoader pluginLoader(directory.absoluteFilePath(fileName));
QObject *plugin = pluginLoader.instance(); QObject *plugin = pluginLoader.instance();
if (!plugin) { if (!plugin) {