ensure objects are in the correct thread when loading

Since we load in a separate thread, when the QObject based objects are
instantiated, they're created with affinity to that separate thread. Now we
specifically ensure they are moved to the main thread after their creation.
This commit is contained in:
itsmattkc
2020-01-14 00:10:21 +11:00
parent 16878e3c25
commit 0ea98be443
19 changed files with 231 additions and 134 deletions
+22 -1
View File
@@ -34,8 +34,23 @@ void Project::Load(QXmlStreamReader *reader)
XMLReadLoop(reader, "project") {
if (reader->isStartElement()) {
if (reader->name() == "folder") {
// Assume this folder is our root
root_.Load(reader);
} else if (reader->name() == "colormanagement") {
// Read color management info
XMLReadLoop(reader, "colormanagement") {
if (reader->name() == "config") {
reader->readNext();
set_ocio_config(reader->text().toString());
} else if (reader->name() == "default") {
reader->readNext();
set_default_input_colorspace(reader->text().toString());
}
}
}
}
}
@@ -49,7 +64,13 @@ void Project::Save(QXmlStreamWriter *writer) const
root_.Save(writer);
writer->writeTextElement("ocio", ocio_config_);
writer->writeStartElement("colormanagement");
writer->writeTextElement("config", ocio_config_);
writer->writeTextElement("default", default_input_colorspace_);
writer->writeEndElement(); // colormanagement
writer->writeEndElement(); // project
}