[rkward] rkward/settings: Rescan for new plugins, also if installation has moved, without changing version number.
Thomas Friedrichsmeier
null at kde.org
Thu Apr 26 07:49:58 UTC 2018
Git commit b5a342ffe6f0af9dd48ca8880fe232ebeb50e422 by Thomas Friedrichsmeier.
Committed on 26/04/2018 at 07:49.
Pushed by tfry into branch 'master'.
Rescan for new plugins, also if installation has moved, without changing version number.
M +3 -1 rkward/settings/rksettingsmodulegeneral.h
M +5 -3 rkward/settings/rksettingsmoduleplugins.cpp
https://commits.kde.org/rkward/b5a342ffe6f0af9dd48ca8880fe232ebeb50e422
diff --git a/rkward/settings/rksettingsmodulegeneral.h b/rkward/settings/rksettingsmodulegeneral.h
index f8e39521..a03af183 100644
--- a/rkward/settings/rksettingsmodulegeneral.h
+++ b/rkward/settings/rksettingsmodulegeneral.h
@@ -2,7 +2,7 @@
rksettingsmodulegeneral - description
-------------------
begin : Fri Jul 30 2004
- copyright : (C) 2004-2015 by Thomas Friedrichsmeier
+ copyright : (C) 2004-2018 by Thomas Friedrichsmeier
email : thomas.friedrichsmeier at kdemail.net
***************************************************************************/
@@ -106,6 +106,8 @@ public:
static bool anyExistingConfig () { return config_exists; };
/** Returns true, if the runtime version of RKWard has changed since the previous session. */
static bool rkwardVersionChanged () { return rkward_version_changed; };
+ /** Returns true, if rkward seems to have started from a different path than on the previous run. */
+ static bool installationMoved () { return installation_moved; };
public slots:
void settingChanged ();
private:
diff --git a/rkward/settings/rksettingsmoduleplugins.cpp b/rkward/settings/rksettingsmoduleplugins.cpp
index 01a02a78..a04e9833 100644
--- a/rkward/settings/rksettingsmoduleplugins.cpp
+++ b/rkward/settings/rksettingsmoduleplugins.cpp
@@ -2,7 +2,7 @@
rksettingsmoduleplugins - description
-------------------
begin : Wed Jul 28 2004
- copyright : (C) 2004-2016 by Thomas Friedrichsmeier
+ copyright : (C) 2004-2018 by Thomas Friedrichsmeier
email : thomas.friedrichsmeier at kdemail.net
***************************************************************************/
@@ -186,8 +186,10 @@ void RKSettingsModulePlugins::loadSettings (KConfig *config) {
known_plugin_maps.append (inf);
}
}
- if (RKSettingsModuleGeneral::rkwardVersionChanged ()) {
- // if it is the first start this version, scan the installation for new pluginmaps
+ if (RKSettingsModuleGeneral::rkwardVersionChanged () || RKSettingsModuleGeneral::installationMoved ()) {
+ // if it is the first start this version or from a new path, scan the installation for new pluginmaps
+ // Note that in the case of installationMoved(), checkAdjustLoadedPath() has already kicked in, above, but rescanning is still useful
+ // e.g. if users have installed to a new location, because they had botched their previous installation
QDir def_plugindir (RKCommonFunctions::getRKWardDataDir ());
QStringList def_pluginmaps = def_plugindir.entryList (QStringList ("*.pluginmap"));
for (int i = 0; i < def_pluginmaps.size (); ++i) {
More information about the rkward-tracker
mailing list