]> git.sesse.net Git - ccbs/blobdiff - bigscreen/top10scorescreen.cpp
Make the "top 10 scores" and "top 5 chosen songs" screens only say they're updated...
[ccbs] / bigscreen / top10scorescreen.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)