[libgames-support] scores: warn if the game does not connect to Context.request_category()



commit 9850d1ee54f36b8e342f8e034f07e2b94ff563de
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Mon Feb 23 09:11:09 2015 -0600

    scores: warn if the game does not connect to Context.request_category()

 scores/context.vala |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/scores/context.vala b/scores/context.vala
index ef0f6dd..a4d2e1f 100644
--- a/scores/context.vala
+++ b/scores/context.vala
@@ -230,7 +230,14 @@ public class Context : Object
             var category = request_category (category_key);
 
             if (category == null)
+            {
+                warning ("GamesScoresContext requested a GamesScoresCategory for the " +
+                         "category %s, but the application did not supply any " +
+                         "GamesScoresCategory. Scores will not be loaded. You should " +
+                         "connect to GamesScoresContext::request-category to supply " +
+                         "a GamesScoresCategory.", category_key);
                 continue;
+            }
 
             var filename = Path.build_filename (user_score_dir, category_key);
             var scores_of_single_category = new Gee.PriorityQueue<Score> ((owned) scorecmp);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]