1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

DataPaths: Only load plugins from first path in portable build

This commit is contained in:
David Rosca 2018-02-26 11:13:22 +01:00
parent 2873cf45a9
commit ec1e30314c
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
2 changed files with 3 additions and 6 deletions

View File

@ -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"));

View File

@ -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")) {