diff options
author | Steru <jerrydream111@gmail.com> | 2024-08-16 15:39:05 +0200 |
---|---|---|
committer | Steru <jerrydream111@gmail.com> | 2024-08-16 15:59:22 +0200 |
commit | 3918de89ce74bea2f18f814edc9accad4af9d818 (patch) | |
tree | b86013c6be31e0f2caec6e00dd9cc82cfa194ad1 /src/model/Competitor.cpp | |
parent | 66d5d8685f7dcd45b2e9581315c101e69646cd6f (diff) |
Fixed constructors.
Diffstat (limited to 'src/model/Competitor.cpp')
-rw-r--r-- | src/model/Competitor.cpp | 13 |
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; } |