Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix XML export for relays qe3. #985

Merged

Conversation

arnost00
Copy link
Contributor

Fix for incomplete relays.
TeamMemberResult - One element per relay leg must be included, even if the team has not assigned any team member to the leg.

IOF XML datastandard v3 - Ln2580

QE3 branch

https://github.com/international-orienteering-federation/datastandard-v3/blob/24eb108e4c6b5e2904e5f8f0e49142e45e2c5230/IOF.xsd#L2580
TeamMemberResult - One element per relay leg must be included, even if the team has not assigned any team member to the leg.
Copy link
Collaborator

@fvacek fvacek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please apply following patch to fix clang-tidy errors

diff --git a/quickevent/app/quickevent/plugins/Relays/src/relaysplugin.cpp b/quickevent/app/quickevent/plugins/Relays/src/relaysplugin.cpp
index 83bf39b9..2ccd1ca8 100644
--- a/quickevent/app/quickevent/plugins/Relays/src/relaysplugin.cpp
+++ b/quickevent/app/quickevent/plugins/Relays/src/relaysplugin.cpp
@@ -28,7 +28,6 @@
 
 #include <qf/core/utils/timescope.h>
 
-namespace qfw = qf::qmlwidgets;
 namespace qff = qf::qmlwidgets::framework;
 namespace qfd = qf::qmlwidgets::dialogs;
 namespace qfm = qf::core::model;
@@ -47,13 +46,9 @@ RelaysPlugin::RelaysPlugin(QObject *parent)
 	connect(this, &RelaysPlugin::installed, this, &RelaysPlugin::onInstalled, Qt::QueuedConnection);
 }
 
-RelaysPlugin::~RelaysPlugin()
-{
-}
-
 QObject *RelaysPlugin::createRelayDocument(QObject *parent)
 {
-	RelayDocument *ret = new  RelayDocument(parent);
+	auto *ret = new  RelayDocument(parent);
 	return ret;
 }
 
@@ -365,7 +360,7 @@ qf::core::utils::TreeTable RelaysPlugin::nLegsClassResultsTable(int class_id, in
 		}
 		std::sort(relay_stime.begin(), relay_stime.end(), [](const LegTime &a, const LegTime &b) {return a.stime < b.stime;});
 		int pos = 0;
-		int winner_time = (relay_stime.size() != 0) ? relay_stime.begin()->stime : 0;
+		int winner_time = (!relay_stime.empty()) ? relay_stime.begin()->stime : 0;
 		for(const auto &p : relay_stime) {
 			int relay_id = p.relayId;
 			for (int i = 0; i < relays.count(); ++i) {
@@ -537,17 +532,17 @@ QVariant RelaysPlugin::startListByClassesTableData(const QString &class_filter)
 	//qfInfo() << tt.toString();
 	return tt.toVariant();
 }
-
-static void append_list(QVariantList &lst, const QVariantList &new_lst)
+namespace {
+void append_list(QVariantList &lst, const QVariantList &new_lst)
 {
 	lst.insert(lst.count(), new_lst);
 }
 
-static QString datetime_to_string(const QDateTime &dt)
+QString datetime_to_string(const QDateTime &dt)
 {
 	return quickevent::core::Utils::dateTimeToIsoStringWithUtcOffset(dt);
 }
-
+}
 QString RelaysPlugin::resultsIofXml30()
 {
 	QDateTime start00 = getPlugin<EventPlugin>()->stageStartDateTime(1);
@@ -678,8 +673,9 @@ QString RelaysPlugin::resultsIofXml30()
 					append_list(team_result, member_result);
 					continue;
 				}
-				else if (time.isValid() && time.msec() == 0)
+				if (time.isValid() && time.msec() == 0) {
 					continue;
+				}
 				QVariantList member_result{"TeamMemberResult"};
 				QVariantList person{"Person"};
 				if (!is_iof_race) {
diff --git a/quickevent/app/quickevent/plugins/Relays/src/relaysplugin.h b/quickevent/app/quickevent/plugins/Relays/src/relaysplugin.h
index b86e9075..52aebd73 100644
--- a/quickevent/app/quickevent/plugins/Relays/src/relaysplugin.h
+++ b/quickevent/app/quickevent/plugins/Relays/src/relaysplugin.h
@@ -30,7 +30,7 @@ private:
 	using Super = qf::qmlwidgets::framework::Plugin;
 public:
 	RelaysPlugin(QObject *parent = nullptr);
-	~RelaysPlugin() Q_DECL_OVERRIDE;
+	~RelaysPlugin() override = default;
 
 	qf::qmlwidgets::framework::PartWidget *partWidget() {return m_partWidget;}

@fvacek fvacek merged commit bdcddad into Quick-Box:qe3 Oct 28, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants