diff options
author | Steru <jerrydream111@gmail.com> | 2024-08-15 23:27:54 +0200 |
---|---|---|
committer | Steru <jerrydream111@gmail.com> | 2024-08-16 23:53:31 +0200 |
commit | b869b8983656b12f9dee59439acfb6b3db647b72 (patch) | |
tree | 9bbb90ed4bfd6c9937beb3f5871ce2a6fbaa7059 /src/model/Competitor.cpp | |
parent | 4f12d941f949bb8b8c1d043ac34772c5c80f1b89 (diff) |
Made Competitor a QObject and tidied up some code.
Diffstat (limited to 'src/model/Competitor.cpp')
-rw-r--r-- | src/model/Competitor.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/model/Competitor.cpp b/src/model/Competitor.cpp index d39d134..080dd4d 100644 --- a/src/model/Competitor.cpp +++ b/src/model/Competitor.cpp @@ -4,12 +4,12 @@ bool Competitor::setCompetitor(const QJsonObject &competitor) { if (!competitor.contains("code") || !competitor.contains("name") - || !competitor.contains("noc")) { + || !competitor.contains("m_noc")) { throw invalid_argument("Not a competitor object."); } - this->code = competitor["code"].toInt(); - this->name = competitor["name"].toString(); - this->noc = competitor["noc"].toString(); + this->m_code = competitor["code"].toInt(); + this->m_name = competitor["name"].toString(); + this->m_noc = competitor["m_noc"].toString(); return true; } |