Skip to content

Commit

Permalink
PluginFactory: Avoid duplicate plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-w committed Mar 23, 2017
1 parent a5aa5e7 commit 0d77cef
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/core/PluginFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
QStringList nameFilters("lib*.so");
#endif

qint64 qHash(const QFileInfo& fi)
{
return qHash(fi.absoluteFilePath());
}

PluginFactory* PluginFactory::s_instance = nullptr;

PluginFactory::PluginFactory()
Expand Down Expand Up @@ -77,7 +82,6 @@ PluginFactory::PluginFactory()

PluginFactory::~PluginFactory()
{

}

PluginFactory* PluginFactory::instance()
Expand Down Expand Up @@ -131,10 +135,10 @@ void PluginFactory::discoverPlugins()
PluginInfoList pluginInfos;
m_pluginByExt.clear();

QFileInfoList files;
QSet<QFileInfo> files;
for (const QString& searchPath : QDir::searchPaths("plugins"))
{
files << QDir(searchPath).entryInfoList(nameFilters);
files.unite(QDir(searchPath).entryInfoList(nameFilters).toSet());
}

// Cheap dependency handling: zynaddsubfx needs ZynAddSubFxCore. By loading
Expand Down

0 comments on commit 0d77cef

Please sign in to comment.