projects
/
scorecard
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sort scores based on dates not the entry date.
[scorecard]
/
src
/
data.cpp
diff --git
a/src/data.cpp
b/src/data.cpp
index
020d701
..
1b0a846
100644
(file)
--- a/
src/data.cpp
+++ b/
src/data.cpp
@@
-132,14
+132,16
@@
void Score::addHole(Hole *iHole) {
holeList << 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("-");
}
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)
int tot = 0;
if (what == Total)
@@
-157,19
+159,23
@@
QString Score::getTotal(int what) {
return QString("%1").arg(tot);
}
return QString("%1").arg(tot);
}
-QString& Score::getClubName() {
+const QString& Score::getClubName() const
+{
return club;
}
return club;
}
-QString& Score::getCourseName() {
+const QString& Score::getCourseName() const
+{
return course;
}
return course;
}
-QString& Score::getDate() {
+const QString& Score::getDate() const
+{
return date;
}
return date;
}
-void Score::dump() {
+void Score::dump()
+{
qDebug() << club << " " << course << " " << date ;
for (int i=0; i<holeList.size(); i++)
holeList.at(i)->dump();
qDebug() << club << " " << course << " " << date ;
for (int i=0; i<holeList.size(); i++)
holeList.at(i)->dump();
@@
-306,7
+312,7
@@
Course *Club::getCourse(int pos) {
return courseList.at(pos);
}
return courseList.at(pos);
}
-Course *Club::getCourse(QString &courseName)
+Course *Club::getCourse(const QString &courseName)
{
QListIterator<Course *> i(courseList);
Course *c = 0;
{
QListIterator<Course *> i(courseList);
Course *c = 0;