summaryrefslogtreecommitdiff
path: root/src/model/Competitor.cpp
diff options
context:
space:
mode:
authorSteru <jerrydream111@gmail.com>2024-08-16 15:39:05 +0200
committerSteru <jerrydream111@gmail.com>2024-08-16 23:53:31 +0200
commitb825a98d95dd9fa432a161d95eb6454536e01af4 (patch)
tree4a55a4f3907d8843cf56eabcbda6629266499123 /src/model/Competitor.cpp
parentb869b8983656b12f9dee59439acfb6b3db647b72 (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;
}