kde/kf6-extra-cmake-modules: rebase to 6.28.0 (ECM) + teach version parser set(VERSION)

kf6-kcoreaddons 6.28.0 requires ECM >= 6.28.0 but the vendored ECM source/ was
still 6.10.0: the sync engine skipped it because ECM's version marker is a bare
set(VERSION "X.Y.Z") that the parser didn't recognize (only KF_VERSION /
PROJECT_VERSION / RELEASE_SERVICE_VERSION). Re-lay ECM from its 6.28.0 source.tar
(pure cmake modules, no Redox port) and teach both the sync engine and the
validator to read set(VERSION) so this class is caught, not silently skipped.
This commit is contained in:
2026-08-01 08:07:00 +03:00
parent 1488226b91
commit e0590a0b56
151 changed files with 1654 additions and 554 deletions
@@ -77,7 +77,11 @@ namespace {
return false;
}
#else
# ifdef Q_OS_MACOS
const QString fullPath = QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, subPath);
# else
const QString fullPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, subPath);
# endif
if (fullPath.isEmpty()) {
return false;
}
@@ -100,16 +104,42 @@ namespace {
loadTranslation(QStringLiteral("en"));
auto langs = getSystemLocale().uiLanguages();
for (auto it = langs.begin(); it != langs.end(); ++it) {
(*it).replace(QLatin1Char('-'), QLatin1Char('_'));
const auto idx = (*it).indexOf(QLatin1Char('_'));
for (int i = 0; i < langs.size(); i++) {
langs[i].replace(QLatin1Char('-'), QLatin1Char('_'));
const auto idx = langs[i].indexOf(QLatin1Char('_'));
if (idx > 0) {
const QString genericLang = (*it).left(idx);
it = langs.insert(++it, genericLang);
// insert the country stripped language to the ideal position,
// that is, after the same language dialects.
// if langs is [pt_Latn_BR, pt_BR], the pt should be inserted
// after pt_BR
const QString genericLang = langs[i].left(idx);
int j = i + 1;
int insertIdx = j;
bool found = false;
while (j < langs.size()) {
if (langs[j] == genericLang) {
found = true;
break;
}
if (langs[j].startsWith(genericLang)) {
insertIdx = j + 1;
}
j++;
}
if (!found) {
langs.insert(insertIdx, genericLang);
}
}
}
langs.removeDuplicates();
for (const auto &lang : langs) {
for (const auto &lang :
#if QT_VERSION_MAJOR == 5
qAsConst(langs)
#else
std::as_const(langs)
#endif
) {
if (lang == QLatin1String("en") || loadTranslation(lang)) {
break;
}