summaryrefslogtreecommitdiff
path: root/src/model/Competitor.cpp
diff options
context:
space:
mode:
authorSteru <jerrydream111@gmail.com>2024-08-16 15:39:05 +0200
committerOrangerot <purple@orangerot.dev>2024-08-26 11:19:38 +0200
commitd40fcd9017ccb441c1859606c6c2583c13ac5866 (patch)
tree206ec6ebcc48d009176407ea5438eed8dbad6511 /src/model/Competitor.cpp
parentb6c86f02ff7ecb74cc96af61d8216b232bcecb3e (diff)
Fixed constructors.
Diffstat (limited to 'src/model/Competitor.cpp')
-rw-r--r--src/model/Competitor.cpp13
1 files changed, 10 insertions, 3 deletions
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;
}