diff options
author | Steru <jerrydream111@gmail.com> | 2024-08-16 15:39:05 +0200 |
---|---|---|
committer | Orangerot <purple@orangerot.dev> | 2024-08-26 11:19:38 +0200 |
commit | d40fcd9017ccb441c1859606c6c2583c13ac5866 (patch) | |
tree | 206ec6ebcc48d009176407ea5438eed8dbad6511 /src/model/Competitor.cpp | |
parent | b6c86f02ff7ecb74cc96af61d8216b232bcecb3e (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; } |