mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-15 01:54:14 +02:00
.qetz format 3: one project database (stage D3a)
project.sqlite now holds both what QElectroTech keeps in its project database (the index D2 wrote as index.sqlite) and the document's engineering data, the latter's tables named doc_<name> beside the former's -- element, element_info, link and conductor exist in both (QetContainerDb's SQL names them as before; Database::sql() puts the prefix on). The manifest says format 3, min-reader 3: a format 2 reader would find no tables of its names. Format 2 files, with or without an index.sqlite entry, are read as before: the prefix is found from the file (doc_meta). A .qetz with an index opens from project.sqlite. Measured: the 136-folio f2099 1.8 s, 5.2 MB (the two table sets still overlap: D3b). Checked: tst_qetcontainer with the format 3 names, 34/34; a format 2 file of the last commit opens from its index.sqlite and saves the same; corpus 342: 340 .qetz carry the index in project.sqlite and open from it, saved back = eager = master on all 342. ctest 96/96 with and without QET_LAZY_FOLIOS=1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -172,7 +172,7 @@ bool QetContainer::readDocument(const QByteArray &content, QDomDocument *documen
|
||||
set if @p project is not a project
|
||||
*/
|
||||
QList<QetZip::Entry> QetContainer::split(const QDomDocument &project, const QString &writer,
|
||||
QString *error)
|
||||
QString *error, const QByteArray &index)
|
||||
{
|
||||
QDomDocument document = project.cloneNode(true).toDocument();
|
||||
QDomElement root = document.documentElement();
|
||||
@@ -182,7 +182,7 @@ QList<QetZip::Entry> QetContainer::split(const QDomDocument &project, const QStr
|
||||
}
|
||||
|
||||
//The engineering data out of the document, into project.sqlite
|
||||
const QByteArray database = QetContainerDb::extract(root, error);
|
||||
const QByteArray database = QetContainerDb::extract(root, error, index);
|
||||
if (database.isEmpty())
|
||||
return {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user