mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-15 01:54:14 +02:00
Merge master into feat/qetz-db-truth-v2
#1470 keeps a .qetz's pictures out of the document; the index path still reads them in, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+16
-1
@@ -283,6 +283,20 @@ QUuid QETProject::uuid() const
|
||||
return m_uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief QETProject::containerPicture
|
||||
The folio pictures of a .qetz are kept as bytes beside the document,
|
||||
not as base64 text in it (QetContainer::join()), for as long as the
|
||||
project is open: a folio built after opening still finds its pictures.
|
||||
They cost almost no memory, sharing their bytes with the pictures
|
||||
built from them.
|
||||
@return the picture in @p file, or an empty array when there is none
|
||||
*/
|
||||
QByteArray QETProject::containerPicture(const QString &file) const
|
||||
{
|
||||
return m_container_pictures.value(file);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief QETProject::derivedItemUuid
|
||||
A uuid for an item of this project that was saved without one, the same
|
||||
@@ -503,9 +517,10 @@ QETProject::ProjectState QETProject::openFile(QFile *file)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!m_opened_from_index && !QetContainer::readDocument(content, &xml_project, &read_error))
|
||||
if (!m_opened_from_index && !QetContainer::readDocument(content, &xml_project, &read_error, &m_container_pictures))
|
||||
{
|
||||
qWarning().noquote() << "Unable to read" << fi.fileName() << ":" << read_error;
|
||||
m_container_pictures.clear();
|
||||
if(opened_here) {
|
||||
file->close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user