mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-15 01:54:14 +02:00
Add, move or remove a folio without building the others (stage D5)
Adding, moving or removing a folio rewrote every folio's position in the project database through diagrams(), which builds every folio: 3 s on a 50-folio project opened lazily. A folio not built has its position and title block already, so folios() is enough. The list of tables a table can continue builds only the folios holding a table (from the index of a .qetz), and the wiring list's count of wires left out looks at built folios only: reading a wire drops it unless both its ends are found. tst_lazyfolios: a folio added, moved and removed builds no other, with the folios' rows as when every folio is built (fails with diagrams(): 47 built); the tables listed as when built, building the 12 folios that hold one (fails when every folio is built). ctest 96/96 eager and lazy; 342 corpus projects save the same in all four arms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1536,8 +1536,10 @@ int projectDataBase::excludedConductorCount() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
//A folio not built (QET_LAZY_FOLIOS) has none: reading a wire
|
||||
//drops it unless both its ends are found (Conductor::fromXml())
|
||||
int count = 0;
|
||||
for (auto *diagram : m_project->diagrams())
|
||||
for (auto *diagram : m_project->builtFolios())
|
||||
{
|
||||
const auto conductor_list = diagram->conductors();
|
||||
for (auto *conductor : conductor_list)
|
||||
@@ -1722,11 +1724,12 @@ void projectDataBase::flushElementPositions()
|
||||
/**
|
||||
@brief projectDataBase::updateFolioPositions
|
||||
Write every folio's position and folio number again, after a folio was
|
||||
added, removed or moved.
|
||||
added, removed or moved. A folio not built yet (QET_LAZY_FOLIOS) has
|
||||
its position and title block already: it is not built for this.
|
||||
*/
|
||||
void projectDataBase::updateFolioPositions()
|
||||
{
|
||||
for (auto diagram : m_project->diagrams())
|
||||
for (auto diagram : m_project->folios())
|
||||
{
|
||||
m_diagram_order_changed.bindValue(":pos", m_project->folioIndex(diagram)+1);
|
||||
m_diagram_order_changed.bindValue(":uuid", diagram->uuid().toString());
|
||||
|
||||
Reference in New Issue
Block a user