]> git.sesse.net Git - ccbs/commitdiff
Make the "top 10 scores" and "top 5 chosen songs" screens only say they're updated...
authorSteinar H. Gunderson <sesse@samfundet.no>
Tue, 1 Mar 2005 00:51:32 +0000 (00:51 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Tue, 1 Mar 2005 00:51:32 +0000 (00:51 +0000)
bigscreen/top10scorescreen.cpp
bigscreen/top5chosenscreen.cpp

index 791c785ec61b4fc0fd30bb5db1bc39a2c6cd809f..2db7bfd4ecc3c167e309d9c42a20c82db235446a 100644 (file)
@@ -20,7 +20,17 @@ bool Top10ScoreScreen::check_invalidated()
        if (!scores_changed.get_flag())
                return false;
 
-       return true;
+       // check that there are indeed changes, otherwise don't bother
+       std::vector<TopScore> scores;
+       conn.perform(FetchTopScoresForTournament(tournament, 10, &scores));
+       
+       for (std::vector<TopScore>::const_iterator i = scores.begin(); i != scores.end(); ++i) {
+               if (seen_topscore.count(*i) == 0) {
+                       return true;
+               }
+       }
+       
+       return false;
 }
 
 void Top10ScoreScreen::draw(unsigned char *buf)
index 1c4e495b2be9f8346624774af12cbfc2a1b64a49..cbb445511b51cf49dd32fec87274472d7f6ff69f 100644 (file)
@@ -20,7 +20,17 @@ bool Top5ChosenScreen::check_invalidated()
        if (!scores_changed.get_flag())
                return false;
 
-       return true;
+       // check that there are indeed changes, otherwise don't bother
+       std::vector<TopChosen> scores;
+       conn.perform(FetchTopChosenSongsForTournament(tournament, 5, &scores));
+
+       for (std::vector<TopChosen>::const_iterator i = scores.begin(); i != scores.end(); ++i) {
+               if (seen_topchosen.count(*i) == 0) {
+                       return true;
+               }       
+       }
+       
+       return false;
 }
 
 void Top5ChosenScreen::draw(unsigned char *buf)