summaryrefslogtreecommitdiff
path: root/src/model/Competitor.cpp
diff options
context:
space:
mode:
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;
}