From 259e6bf8292560defc36593e8ef65eecae809211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Paukert?= Date: Sun, 7 Aug 2022 16:38:15 +0200 Subject: [PATCH] Remove Time element from IOF XML 3.0 export if SplitTime is missing --- .../app/quickevent/plugins/Relays/src/relaysplugin.cpp | 5 ++++- quickevent/app/quickevent/plugins/Runs/src/runsplugin.cpp | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/quickevent/app/quickevent/plugins/Relays/src/relaysplugin.cpp b/quickevent/app/quickevent/plugins/Relays/src/relaysplugin.cpp index 2cbef5347..15dd4508b 100644 --- a/quickevent/app/quickevent/plugins/Relays/src/relaysplugin.cpp +++ b/quickevent/app/quickevent/plugins/Relays/src/relaysplugin.cpp @@ -717,7 +717,10 @@ QString RelaysPlugin::resultsIofXml30() } QVariantList split{QStringLiteral("SplitTime")}; append_list(split, QVariantList{"ControlCode", cd.code()}); - append_list(split, QVariantList{"Time", time / 1000}); + if(time == 0) + split.insert(1, QVariantMap{ {QStringLiteral("status"), QStringLiteral("Missing")} }); + else + append_list(split, QVariantList{"Time", time / 1000}); append_list(person_result, split); } } diff --git a/quickevent/app/quickevent/plugins/Runs/src/runsplugin.cpp b/quickevent/app/quickevent/plugins/Runs/src/runsplugin.cpp index 7eea7fde8..736bc2e0c 100644 --- a/quickevent/app/quickevent/plugins/Runs/src/runsplugin.cpp +++ b/quickevent/app/quickevent/plugins/Runs/src/runsplugin.cpp @@ -927,10 +927,11 @@ bool RunsPlugin::exportResultsIofXml30Stage(int stage_id, const QString &file_na QVariantList split_time{ QStringLiteral("SplitTime"), QVariantList{QStringLiteral("ControlCode"), cd.code() }, - QVariantList{QStringLiteral("Time"), stp_time / 1000 }, }; if(stp_time == 0) split_time.insert(1, QVariantMap{ {QStringLiteral("status"), QStringLiteral("Missing")} }); + else + split_time.insert(split_time.count(), QVariantList{QStringLiteral("Time"), stp_time / 1000}); result.insert(result.count(), split_time); ix += 4; }