diff --git a/src/lib/plugins/plugins.cpp b/src/lib/plugins/plugins.cpp index a134a7138..f9100a102 100644 --- a/src/lib/plugins/plugins.cpp +++ b/src/lib/plugins/plugins.cpp @@ -87,6 +87,13 @@ void Plugins::loadSettings() m_allowedPlugins = settings.value("AllowedPlugins", QStringList()).toStringList(); settings.endGroup(); + // Plugins are saved with relative path in portable mode + if (mApp->isPortable()) { + QDir dir(DataPaths::path(DataPaths::Plugins)); + for (int i = 0; i < m_allowedPlugins.count(); ++i) + m_allowedPlugins[i] = dir.absoluteFilePath(m_allowedPlugins[i]); + } + c2f_loadSettings(); } @@ -166,12 +173,8 @@ void Plugins::loadAvailablePlugins() QStringList dirs = DataPaths::allPaths(DataPaths::Plugins); // Portable build: Load only plugins from DATADIR/plugins/ directory. - // Loaded plugins are saved with relative path, instead of absolute for - // normal build. - - if (mApp->isPortable()) { + if (mApp->isPortable()) dirs = QStringList(DataPaths::path(DataPaths::Plugins)); - } foreach (const QString &dir, dirs) { QDir pluginsDir = QDir(dir); diff --git a/src/lib/preferences/pluginsmanager.cpp b/src/lib/preferences/pluginsmanager.cpp index 6ecdf2860..6133c4344 100644 --- a/src/lib/preferences/pluginsmanager.cpp +++ b/src/lib/preferences/pluginsmanager.cpp @@ -115,12 +115,11 @@ void PluginsManager::save() if (item->checkState() == Qt::Checked) { const Plugins::Plugin plugin = item->data(Qt::UserRole + 10).value(); - if (!mApp->isPortable()) { - allowedPlugins.append(plugin.fullPath); - } - else { + // Save plugins with relative path in portable mode + if (mApp->isPortable()) allowedPlugins.append(plugin.fileName); - } + else + allowedPlugins.append(plugin.fullPath); } }