In main window, update also course data after entering new score
authorSakari Poussa <spoussa@gmail.com>
Sat, 26 Dec 2009 16:51:28 +0000 (18:51 +0200)
committerSakari Poussa <spoussa@gmail.com>
Sat, 26 Dec 2009 16:51:28 +0000 (18:51 +0200)
TODO
src/table-model.cpp
src/table-model.h

diff --git a/TODO b/TODO
index 0d02784..b6f6922 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,9 +1,6 @@
 TOP Items
 
 TODO General:
-- Always: when enterin ultiple scores, course does not update on
-  mainwiew. Window title is correct, but par/hcp info is not from the
-  same course. Next/prev few times corrects the problem.
 - New score dialog should be the same as main view (f.ex showing
   subtotals, totals, and score colors).
 - edit course table is selectable (chk others)
index 6c490ed..3bcf1b3 100644 (file)
@@ -41,6 +41,7 @@ void ScoreTableModel::setScore(QList<Score *> &sList, Score *s)
        currentScore = 0;
     }
     score = scoreList.at(currentScore); // NOTE: assumes non-empty list
+    course = findCourse(score->getClubName(), score->getCourseName());
   }
 }
 
index 9c6cb7c..9c07f25 100644 (file)
@@ -35,8 +35,8 @@ public:
   void setMode(int m);
   int mode(void);
   void setScore(QList<Score *> &sList, Score *score = 0);
-  Score *getScore(void);
   void setClub(QList<Club *> &cList);
+  Score *getScore(void);
   Club *getClub(void);
   Course *getCourse(void);