X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fdata.cpp;h=1b0a8460458c4851b97c56c026fcfbbb5f94cdaa;hb=1362d51e8c026dd31200a9934a13e017b19a327b;hp=020d701aed7cbaaa32c1cc15f29c1bc01da42f5f;hpb=ddd5f3a00f4f60bde20023883780ab31e1468ddc;p=scorecard diff --git a/src/data.cpp b/src/data.cpp index 020d701..1b0a846 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -132,14 +132,16 @@ void Score::addHole(Hole *iHole) { holeList << iHole; } -QString Score::getScore(int i) { +QString Score::getScore(int i) const +{ if (i >= 0 && i < holeList.size()) return holeList.at(i)->getShots(); else return QString("-"); } -QString Score::getTotal(int what) { +QString Score::getTotal(int what) const +{ int tot = 0; if (what == Total) @@ -157,19 +159,23 @@ QString Score::getTotal(int what) { return QString("%1").arg(tot); } -QString& Score::getClubName() { +const QString& Score::getClubName() const +{ return club; } -QString& Score::getCourseName() { +const QString& Score::getCourseName() const +{ return course; } -QString& Score::getDate() { +const QString& Score::getDate() const +{ return date; } -void Score::dump() { +void Score::dump() +{ qDebug() << club << " " << course << " " << date ; for (int i=0; idump(); @@ -306,7 +312,7 @@ Course *Club::getCourse(int pos) { return courseList.at(pos); } -Course *Club::getCourse(QString &courseName) +Course *Club::getCourse(const QString &courseName) { QListIterator i(courseList); Course *c = 0;