diff --git a/src/app/app_version.h.cmakein b/src/app/app_version.h.cmakein index 7fa0a830ddf..6d69f0d5dea 100644 --- a/src/app/app_version.h.cmakein +++ b/src/app/app_version.h.cmakein @@ -43,6 +43,7 @@ const char IDE_ID[] = "${IDE_ID}"; const char IDE_CASED_ID[] = "${IDE_CASED_ID}"; const char IDE_VERSION_DISPLAY[] = "${IDE_VERSION_DISPLAY}"; +const char IDE_VERSION_COMPAT[] = "${IDE_VERSION_COMPAT}"; const char IDE_REVISION_STR[] = "${IDE_REVISION_STR}"; const char IDE_REVISION_URL_STR[] = "${IDE_REVISION_URL_STR}"; diff --git a/src/app/app_version.h.in b/src/app/app_version.h.in index a3fc7f4b4ee..4682d282efb 100644 --- a/src/app/app_version.h.in +++ b/src/app/app_version.h.in @@ -38,6 +38,7 @@ const char IDE_CASED_ID[] = \"$${IDE_CASED_ID}\"; #define IDE_VERSION $${QTCREATOR_VERSION} #define IDE_VERSION_STR STRINGIFY(IDE_VERSION) #define IDE_VERSION_DISPLAY_DEF $${QTCREATOR_DISPLAY_VERSION} +#define IDE_VERSION_COMPAT_DEF $${QTCREATOR_COMPAT_VERSION} #define IDE_VERSION_MAJOR $$replace(QTCREATOR_VERSION, "^(\\d+)\\.\\d+\\.\\d+(-.*)?$", \\1) #define IDE_VERSION_MINOR $$replace(QTCREATOR_VERSION, "^\\d+\\.(\\d+)\\.\\d+(-.*)?$", \\1) @@ -45,6 +46,7 @@ const char IDE_CASED_ID[] = \"$${IDE_CASED_ID}\"; const char IDE_VERSION_LONG[] = IDE_VERSION_STR; const char IDE_VERSION_DISPLAY[] = STRINGIFY(IDE_VERSION_DISPLAY_DEF); +const char IDE_VERSION_COMPAT[] = STRINGIFY(IDE_VERSION_COMPAT_DEF); const char IDE_AUTHOR[] = \"The Qt Company Ltd\"; const char IDE_YEAR[] = \"$${QTCREATOR_COPYRIGHT_YEAR}\"; @@ -73,6 +75,7 @@ const char IDE_COPY_SETTINGS_FROM_VARIANT_STR[] = STRINGIFY(IDE_COPY_SETTINGS_FR const char IDE_COPY_SETTINGS_FROM_VARIANT_STR[] = \"\"; #endif +#undef IDE_VERSION_COMPAT_DEF #undef IDE_VERSION_DISPLAY_DEF #undef IDE_VERSION #undef IDE_VERSION_STR diff --git a/src/app/app_version_header.qbs b/src/app/app_version_header.qbs index 8bd2bc65bc3..4dd44c23851 100644 --- a/src/app/app_version_header.qbs +++ b/src/app/app_version_header.qbs @@ -34,6 +34,8 @@ Product { // replace the magic qmake incantations content = content.replace(/(\n#define IDE_VERSION_DISPLAY_DEF) .+\n/, "$1 " + product.moduleProperty("qtc", "qtcreator_display_version") + "\n"); + content = content.replace(/(\n#define IDE_VERSION_COMPAT_DEF) .+\n/, "$1 " + + product.moduleProperty("qtc", "qtcreator_compat_version") + "\n"); content = content.replace(/(\n#define IDE_VERSION) .+\n/, "$1 " + product.moduleProperty("qtc", "qtcreator_version") + "\n"); content = content.replace(/(\n#define IDE_VERSION_MAJOR) .+\n/, "$1 " diff --git a/src/app/main.cpp b/src/app/main.cpp index f2adb8b6206..cd566f218f6 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -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; }