From 6cac8b50cee905449d48c1fb52197d071be9b7d3 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Fri, 23 Dec 2016 15:01:19 +0100 Subject: [PATCH] Plugins: Use relative paths when NO_SYSTEM_DATAPATH is set --- src/lib/plugins/plugins.cpp | 6 ++++++ src/lib/preferences/pluginsmanager.cpp | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/lib/plugins/plugins.cpp b/src/lib/plugins/plugins.cpp index 7aaaa6345..5a1403c3f 100644 --- a/src/lib/plugins/plugins.cpp +++ b/src/lib/plugins/plugins.cpp @@ -88,7 +88,11 @@ void Plugins::loadSettings() settings.endGroup(); // Plugins are saved with relative path in portable mode +#ifdef NO_SYSTEM_DATAPATH + if (true) { +#else if (mApp->isPortable()) { +#endif QDir dir(DataPaths::path(DataPaths::Plugins)); for (int i = 0; i < m_allowedPlugins.count(); ++i) m_allowedPlugins[i] = dir.absoluteFilePath(m_allowedPlugins[i]); @@ -173,7 +177,9 @@ void Plugins::loadAvailablePlugins() QStringList dirs = DataPaths::allPaths(DataPaths::Plugins); // Portable build: Load only plugins from DATADIR/plugins/ directory. +#ifndef NO_SYSTEM_DATAPATH if (mApp->isPortable()) +#endif dirs = QStringList(DataPaths::path(DataPaths::Plugins)); foreach (const QString &dir, dirs) { diff --git a/src/lib/preferences/pluginsmanager.cpp b/src/lib/preferences/pluginsmanager.cpp index 32cb341e2..a76b86503 100644 --- a/src/lib/preferences/pluginsmanager.cpp +++ b/src/lib/preferences/pluginsmanager.cpp @@ -75,7 +75,11 @@ void PluginsManager::save() const Plugins::Plugin plugin = item->data(Qt::UserRole + 10).value(); // Save plugins with relative path in portable mode +#ifdef NO_SYSTEM_DATAPATH + if (true) +#else if (mApp->isPortable()) +#endif allowedPlugins.append(plugin.fileName); else allowedPlugins.append(plugin.fullPath);