[gnome-nibbles] Update for scores API change



commit df88ee25ed2b69b8cb8668091faab7f58e95469f
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sat Sep 19 17:35:15 2015 -0500

    Update for scores API change

 src/gnome-nibbles.vala |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/src/gnome-nibbles.vala b/src/gnome-nibbles.vala
index 9a22a1d..f46da8b 100644
--- a/src/gnome-nibbles.vala
+++ b/src/gnome-nibbles.vala
@@ -530,9 +530,23 @@ public class Nibbles : Gtk.Application
     * * Scoring
     \*/
 
+    private Games.Scores.Category category_request (string key)
+    {
+        foreach (var cat in scorecats)
+        {
+            if (key == cat.key)
+                return cat;
+        }
+        assert_not_reached ();
+    }
+
     private void create_scores ()
     {
-        scores_context = new Games.Scores.Context ("gnome-nibbles", "", window, 
Games.Scores.Style.PLAIN_DESCENDING);
+        scores_context = new Games.Scores.Context ("gnome-nibbles",
+                                                   "",
+                                                   window,
+                                                   category_request,
+                                                   Games.Scores.Style.PLAIN_DESCENDING);
 
         scorecats = new Gee.LinkedList<Games.Scores.Category> ();
         scorecats.add (new Games.Scores.Category ("beginner", "Beginner"));
@@ -543,15 +557,6 @@ public class Nibbles : Gtk.Application
         scorecats.add (new Games.Scores.Category ("slow-fakes", "Slow with Fakes"));
         scorecats.add (new Games.Scores.Category ("medium-fakes", "Medium with Fakes"));
         scorecats.add (new Games.Scores.Category ("fast-fakes", "Fast with Fakes"));
-
-        scores_context.category_request.connect ((s, key) => {
-            foreach (var cat in scorecats)
-            {
-                if (key == cat.key)
-                    return cat;
-            }
-            return null;
-        });
     }
 
     private Games.Scores.Category get_scores_category (int speed, bool fakes)


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