Take compatibility version into account for user plugins

When loading user-local plugins, do not load plugins for all patch
versions starting from .0 unconditionally. Take the compatibility
version into account.

That fixes that prereleases x.y.82 etc should not try loading plugins
for any actual x.y.z release.

Change-Id: Ide0931bbdef4f48e08dcc3213f7c193c8889fb0f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Eike Ziller
2020-03-02 13:36:14 +01:00
parent 8bb3b3c4f1
commit d6c95ef365
4 changed files with 10 additions and 1 deletions

View File

@@ -237,7 +237,10 @@ static inline QStringList getPluginPaths()
// patch versions
const QString minorVersion = QString::number(IDE_VERSION_MAJOR) + '.'
+ QString::number(IDE_VERSION_MINOR) + '.';
for (int patchVersion = IDE_VERSION_RELEASE; patchVersion >= 0; --patchVersion)
const int minPatchVersion
= qMin(IDE_VERSION_RELEASE,
QVersionNumber::fromString(Core::Constants::IDE_VERSION_COMPAT).microVersion());
for (int patchVersion = IDE_VERSION_RELEASE; patchVersion >= minPatchVersion; --patchVersion)
rc.push_back(pluginPath + minorVersion + QString::number(patchVersion));
return rc;
}