various: use simpler/smarter XML reading functions

Should address any XML parsing issues and allows for simpler, more maintainable
code. Should also address a crash that could occur when pasting nodes that had
inputs that weren't copied.
This commit is contained in:
itsmattkc
2020-03-17 02:38:17 +11:00
parent 72eb3a5d82
commit a1f5c85f49
16 changed files with 326 additions and 285 deletions
+2 -3
View File
@@ -5,9 +5,6 @@
#include "node/node.h"
#define XMLReadLoop(reader, section) \
while (!reader->atEnd() && !(reader->name() == section && reader->isEndElement()) && reader->readNext())
#define XMLAttributeLoop(reader, item) \
QXmlStreamAttributes __attributes = reader->attributes(); \
foreach (const QXmlStreamAttribute& item, __attributes)
@@ -16,4 +13,6 @@ Node *XMLLoadNode(QXmlStreamReader* reader);
void XMLConnectNodes(const QHash<quintptr, NodeOutput *> &output_ptrs, const QList<NodeParam::SerializedConnection> &desired_connections);
bool XMLReadNextStartElement(QXmlStreamReader* reader);
#endif // XMLREADLOOP_H