From ec1e30314c29995e2bc60029bfb01696e67c0374 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Mon, 26 Feb 2018 11:13:22 +0100 Subject: [PATCH] DataPaths: Only load plugins from first path in portable build --- src/lib/app/datapaths.cpp | 1 + src/lib/plugins/plugins.cpp | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/lib/app/datapaths.cpp b/src/lib/app/datapaths.cpp index 604260a83..a5854850b 100644 --- a/src/lib/app/datapaths.cpp +++ b/src/lib/app/datapaths.cpp @@ -48,6 +48,7 @@ void DataPaths::setPortableVersion() { DataPaths* d = qz_data_paths(); d->m_paths[Config] = d->m_paths[AppData]; + d->m_paths[Plugins] = QStringList{d->m_paths[Plugins].at(0)}; d->m_paths[Profiles] = d->m_paths[Config]; d->m_paths[Profiles].first().append(QLatin1String("/profiles")); diff --git a/src/lib/plugins/plugins.cpp b/src/lib/plugins/plugins.cpp index 6128312e0..c950a4d55 100644 --- a/src/lib/plugins/plugins.cpp +++ b/src/lib/plugins/plugins.cpp @@ -148,17 +148,13 @@ void Plugins::loadAvailablePlugins() m_pluginsLoaded = true; - QStringList dirs = DataPaths::allPaths(DataPaths::Plugins); - - // Portable build: Load only plugins from DATADIR/plugins/ directory. - if (mApp->isPortable()) - dirs = QStringList(DataPaths::path(DataPaths::Plugins)); + const QStringList dirs = DataPaths::allPaths(DataPaths::Plugins); // InternalPlugin registerAvailablePlugin(loadInternalPlugin(QSL("adblock"))); // SharedLibraryPlugin - for (const QString &dir : qAsConst(dirs)) { + for (const QString &dir : dirs) { const auto files = QDir(dir).entryInfoList(QDir::Files); for (const QFileInfo &info : files) { if (info.baseName() == QL1S("PyFalkon")) {