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:
parent
fe6005bb26
commit
6cac8b50ce
|
@ -88,7 +88,11 @@ void Plugins::loadSettings()
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
// Plugins are saved with relative path in portable mode
|
// Plugins are saved with relative path in portable mode
|
||||||
|
#ifdef NO_SYSTEM_DATAPATH
|
||||||
|
if (true) {
|
||||||
|
#else
|
||||||
if (mApp->isPortable()) {
|
if (mApp->isPortable()) {
|
||||||
|
#endif
|
||||||
QDir dir(DataPaths::path(DataPaths::Plugins));
|
QDir dir(DataPaths::path(DataPaths::Plugins));
|
||||||
for (int i = 0; i < m_allowedPlugins.count(); ++i)
|
for (int i = 0; i < m_allowedPlugins.count(); ++i)
|
||||||
m_allowedPlugins[i] = dir.absoluteFilePath(m_allowedPlugins[i]);
|
m_allowedPlugins[i] = dir.absoluteFilePath(m_allowedPlugins[i]);
|
||||||
|
@ -173,7 +177,9 @@ void Plugins::loadAvailablePlugins()
|
||||||
QStringList dirs = DataPaths::allPaths(DataPaths::Plugins);
|
QStringList dirs = DataPaths::allPaths(DataPaths::Plugins);
|
||||||
|
|
||||||
// Portable build: Load only plugins from DATADIR/plugins/ directory.
|
// Portable build: Load only plugins from DATADIR/plugins/ directory.
|
||||||
|
#ifndef NO_SYSTEM_DATAPATH
|
||||||
if (mApp->isPortable())
|
if (mApp->isPortable())
|
||||||
|
#endif
|
||||||
dirs = QStringList(DataPaths::path(DataPaths::Plugins));
|
dirs = QStringList(DataPaths::path(DataPaths::Plugins));
|
||||||
|
|
||||||
foreach (const QString &dir, dirs) {
|
foreach (const QString &dir, dirs) {
|
||||||
|
|
|
@ -75,7 +75,11 @@ void PluginsManager::save()
|
||||||
const Plugins::Plugin plugin = item->data(Qt::UserRole + 10).value<Plugins::Plugin>();
|
const Plugins::Plugin plugin = item->data(Qt::UserRole + 10).value<Plugins::Plugin>();
|
||||||
|
|
||||||
// Save plugins with relative path in portable mode
|
// Save plugins with relative path in portable mode
|
||||||
|
#ifdef NO_SYSTEM_DATAPATH
|
||||||
|
if (true)
|
||||||
|
#else
|
||||||
if (mApp->isPortable())
|
if (mApp->isPortable())
|
||||||
|
#endif
|
||||||
allowedPlugins.append(plugin.fileName);
|
allowedPlugins.append(plugin.fileName);
|
||||||
else
|
else
|
||||||
allowedPlugins.append(plugin.fullPath);
|
allowedPlugins.append(plugin.fullPath);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user