From 0c958d3b667df411f270532184a816c7ac0819d3 Mon Sep 17 00:00:00 2001 From: ispyisail Date: Mon, 21 Sep 2026 21:59:37 +1200 Subject: [PATCH] Drop "version" from the folio properties: it was a silent no-op setFolioProperty(f, "version", "V9-USER") returned true and changed nothing. TitleBlockProperties::version is the file-format stamp QElectroTech writes on every save, so a value set through the API reads back as "0.200.1-dev" and is what ends up in the file. A property that reports success and does nothing is the failure this API is careful to avoid everywhere else, so it is removed rather than documented. It went in untested: the earlier verification set author and plant and never tried the other six names. Co-Authored-By: Claude Sonnet 5 --- sources/scripting/qetscriptapi.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sources/scripting/qetscriptapi.cpp b/sources/scripting/qetscriptapi.cpp index 3e0e1e7ad..70df3fd19 100644 --- a/sources/scripting/qetscriptapi.cpp +++ b/sources/scripting/qetscriptapi.cpp @@ -1494,7 +1494,9 @@ QString *titleBlockField(TitleBlockProperties &p, const QString &name) if (name == QLatin1String("plant")) return &p.plant; if (name == QLatin1String("locmach")) return &p.locmach; if (name == QLatin1String("indexrev")) return &p.indexrev; - if (name == QLatin1String("version")) return &p.version; + // Not "version": TitleBlockProperties::version is the file-format stamp + // QElectroTech writes on every save, so a value set here reports success + // and is overwritten -- measured: set "V9-USER", read back "0.200.1-dev". if (name == QLatin1String("folio")) return &p.folio; return nullptr; } @@ -1502,7 +1504,7 @@ const QStringList &titleBlockFieldNames() { static const QStringList n{QStringLiteral("title"), QStringLiteral("author"), QStringLiteral("filename"), QStringLiteral("plant"), QStringLiteral("locmach"), - QStringLiteral("indexrev"), QStringLiteral("version"), QStringLiteral("folio")}; + QStringLiteral("indexrev"), QStringLiteral("folio")}; return n; } } // namespace @@ -1520,7 +1522,7 @@ QString QetScriptApi::folioProperty(int folioIndex, const QString &property) con /** @brief QetScriptApi::setFolioProperty Set one text field of a folio's title block (title, author, filename, - plant, locmach, indexrev, version, folio) via ChangeTitleBlockCommand, + plant, locmach, indexrev, folio) via ChangeTitleBlockCommand, like setFolioTitle() which this generalises. The date and the template are not offered: the date has a use-current-date mode that a plain string cannot express honestly.