Keep the project's numbering in the project database only

QETProject no longer holds its numbering schemes and their settings in
hashes and members of its own: every accessor reads and writes the
project database's numbering tables (QETZ-DB-FIRST stage 2b-3), which
the save already writes from. projectDataBase gains per-scheme calls
(numberingSchemes, numberingScheme, setNumberingScheme,
removeNumberingScheme, renameNumberingScheme, the scheme uuid and
title, and the settings); setNumbering() is what reading the file
writes, in one go once it is all read.

QET_CHECK_NUMBERING_ROWS goes: there is one copy left to compare. The
test now checks the scheme list after each change through the script
API, that no part row is left without its scheme, and the saved file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ispyisail
2026-10-20 06:02:39 +13:00
parent de248eb20a
commit 122678a797
5 changed files with 426 additions and 283 deletions
+15
View File
@@ -179,6 +179,21 @@ class projectDataBase : public QObject
};
void setNumbering(const Numbering &numbering);
Numbering numbering() const;
QHash<QString, NumerotationContext> numberingSchemes(const QString &kind) const;
bool hasNumberingScheme(const QString &kind, const QString &title) const;
NumerotationContext numberingScheme(const QString &kind, const QString &title) const;
QUuid numberingSchemeUuid(const QString &kind, const QString &title) const;
QString numberingSchemeTitle(const QString &kind, const QUuid &uuid) const;
void setNumberingScheme(const QString &kind, const QString &title,
const NumerotationContext &context,
const QUuid &uuid = QUuid());
void removeNumberingScheme(const QString &kind, const QString &title);
void renameNumberingScheme(const QString &kind, const QString &old_title,
const QString &new_title);
QString numberingSetting(const QString &name, const QString &default_value = QString()) const;
bool numberingFlag(const QString &name, bool default_value) const;
void setNumberingSetting(const QString &name, const QString &value);
void setNumberingFlag(const QString &name, bool value);
bool savedLinks(const Element *element, QList<std::pair<QUuid, int>> *links);
//The link rows are written (opening filled them): a symbol
//built links from them (Element::initLink())