mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-22 22:34:13 +02:00
Show a folio without building its partners' folios (stage D5b)
Showing a folio built it and every folio holding a partner of its symbols. Now a partner is built alone, as a symbol, into its folio's scene (Diagram::buildSymbols()), and reused when that folio is built. - A linked folio report built alone had no wires when it was linked, so its texts showing a wire's properties stayed empty: after any build, linked reports on the built folios and their partners look at their wires again, as opening does. Unlinked reports keep their texts, as opening leaves them. - A report whose partner was built alone builds the partner's folio when its potential is followed. - tableChainFolios() parsed every unbuilt folio's file. The index now lists the drawn tables and the table each continues (folio_table), and a .qetz opened from it uses that list. An index without it falls back to the folio files. - A .qetz's project.sqlite is opened once per project (QetContainerDb::FolioReader), not once per folio built. nuri (136 folios), opened fresh, one folio shown: median 1104 -> 184 ms, each show builds one folio; industrial 234 -> 87 ms. tst_lazyfolios: a folio whose table continues another is shown first from a .qetz (fails when the index's chains are ignored). ctest 96/96 eager and lazy; 342-project corpus: master, lazy, .qetz lazy and .qetz kept all the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -355,7 +355,8 @@ QList<QetZip::Entry> QetContainer::split(const QDomDocument &project, const QStr
|
||||
engineering data back from project.sqlite.
|
||||
*/
|
||||
bool QetContainer::readFolio(const QHash<QString, QByteArray> &files, const QString &file,
|
||||
QDomDocument *folio, QString *error)
|
||||
QDomDocument *folio, QString *error,
|
||||
QetContainerDb::FolioReader *reader)
|
||||
{
|
||||
if (!files.contains(file)) {
|
||||
setError(error, QStringLiteral("part \"%1\" is missing").arg(file));
|
||||
@@ -380,9 +381,11 @@ bool QetContainer::readFolio(const QHash<QString, QByteArray> &files, const QStr
|
||||
image.insertBefore(folio->createTextNode(QString::fromLatin1(files.value(picture).toBase64())),
|
||||
image.firstChild());
|
||||
}
|
||||
return !files.contains(QStringLiteral("project.sqlite"))
|
||||
|| QetContainerDb::restoreFolio(folio->documentElement(),
|
||||
files.value(QStringLiteral("project.sqlite")), error);
|
||||
if (!files.contains(QStringLiteral("project.sqlite")))
|
||||
return true;
|
||||
return reader ? reader->restore(folio->documentElement(), error)
|
||||
: QetContainerDb::restoreFolio(folio->documentElement(),
|
||||
files.value(QStringLiteral("project.sqlite")), error);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user