1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-19 10:16:34 +01:00

[Portable] Save loaded plugins with relative path.

It is now possible to correctly load plugins even when
eg. disk label on Windows changes.
This commit is contained in:
nowrep 2013-04-11 23:24:19 +02:00
parent db6f4333f2
commit 83b7f6d1c0
3 changed files with 10 additions and 0 deletions

View File

@ -7,6 +7,7 @@ Version 1.5.0
* cancel upload when trying to upload non-readable files
* GreaseMonkey: added support for GM_Settings
* fixed: size of preferences dialog on low-res screens
* fixed: loading plugins with relative paths in portable build
Version 1.4.1
* released 15 March 2013

View File

@ -163,6 +163,10 @@ void Plugins::loadAvailablePlugins()
QStringList dirs;
dirs << mApp->DATADIR + "plugins/"
// Portable build: Load only plugins from DATADIR/plugins/ directory.
// Loaded plugins are saved with relative path, instead of absolute for
// normal build.
#ifndef PORTABLE_BUILD
#if defined(QZ_WS_X11) && !defined(NO_SYSTEM_DATAPATH)
#ifdef USE_LIBPATH
<< USE_LIBPATH "qupzilla/"
@ -171,6 +175,7 @@ void Plugins::loadAvailablePlugins()
#endif
#endif
<< mApp->PROFILEDIR + "plugins/";
#endif
foreach (const QString &dir, dirs) {
QDir pluginsDir = QDir(dir);

View File

@ -113,7 +113,11 @@ void PluginsManager::save()
if (item->checkState() == Qt::Checked) {
const Plugins::Plugin plugin = item->data(Qt::UserRole + 10).value<Plugins::Plugin>();
#ifndef PORTABLE_BUILD
allowedPlugins.append(plugin.fullPath);
#else
allowedPlugins.append(mApp->DATADIR + "plugins/" + plugin.fileName);
#endif
}
}