From 3918de89ce74bea2f18f814edc9accad4af9d818 Mon Sep 17 00:00:00 2001 From: Steru Date: Fri, 16 Aug 2024 15:39:05 +0200 Subject: Fixed constructors. --- src/model/Competitor.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/model/Competitor.cpp') diff --git a/src/model/Competitor.cpp b/src/model/Competitor.cpp index 080dd4d..a584689 100644 --- a/src/model/Competitor.cpp +++ b/src/model/Competitor.cpp @@ -8,8 +8,15 @@ bool Competitor::setCompetitor(const QJsonObject &competitor) { throw invalid_argument("Not a competitor object."); } - this->m_code = competitor["code"].toInt(); - this->m_name = competitor["name"].toString(); - this->m_noc = competitor["m_noc"].toString(); + setCode(competitor["code"].toInt()); + setName(competitor["name"].toString()); + setNOC(competitor["m_noc"].toString()); + return true; +} + +bool Competitor::setCompetitor(const Competitor &competitor) { + setCode(competitor.m_code); + setName(competitor.m_name); + setNOC(competitor.m_noc); return true; } -- cgit v1.2.3