summaryrefslogtreecommitdiff
path: root/src/projectserialiser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/projectserialiser.cc')
-rw-r--r--src/projectserialiser.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/projectserialiser.cc b/src/projectserialiser.cc
index ced4636..ac872c7 100644
--- a/src/projectserialiser.cc
+++ b/src/projectserialiser.cc
@@ -39,6 +39,8 @@
</dgedit>
*/
+extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed;
+
class DomHelper
{
public:
@@ -104,6 +106,10 @@ private:
QString ProjectSerialiser::serialise(const Project& project)
{
+ // Ugly hack to ensure the xml attribute order is the same each time a save
+ // or export is performed.
+ qt_qhash_seed.store(0);
+
QDomDocument doc;
auto header =
doc.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'");
@@ -177,6 +183,7 @@ QString ProjectSerialiser::serialise(const Project& project)
file.setAttribute("name", audiofile.getName());
file.setAttribute("channel_map_id", audiofile.getChannelMapId());
file.setAttribute("master", i.master_file == audiofile.getAbsoluteFile());
+ file.setAttribute("main", audiofile.getMainChannel() ? "true" : "false");
file_list.appendChild(file);
}
@@ -204,6 +211,10 @@ QString ProjectSerialiser::serialise(const Project& project)
bool ProjectSerialiser::deserialise(const QString& data, Project& project)
{
+ // Ugly hack to ensure the xml attribute order is the same each time a save
+ // or export is performed.
+ qt_qhash_seed.store(0);
+
QDomDocument doc;
if(!doc.setContent(data))
{
@@ -255,6 +266,7 @@ bool ProjectSerialiser::deserialise(const QString& data, Project& project)
audiofile.file = file.text();
audiofile.name = file["name"];
audiofile.channel_map_id = file["channel_map_id"].toInt();
+ audiofile.main_channel = file["main"] == "true";
if(file["master"] == "1")
{