1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Plugins: Use relative paths when NO_SYSTEM_DATAPATH is set

This commit is contained in:
David Rosca 2016-12-23 15:01:19 +01:00
parent fe6005bb26
commit 6cac8b50ce
2 changed files with 10 additions and 0 deletions

View File

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

View File

@ -75,7 +75,11 @@ void PluginsManager::save()
const Plugins::Plugin plugin = item->data(Qt::UserRole + 10).value<Plugins::Plugin>();
// 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);