[libgames-support] Load scores in has_scores()



commit db5bc92b46a36375ea1b6f99dee6220baf4f214a
Author: Juan R. GarcĂ­a Blanco <juanrgar gmail com>
Date:   Tue Mar 3 21:50:52 2015 +0100

    Load scores in has_scores()
    
        * See https://bugzilla.gnome.org/show_bug.cgi?id=745025

 scores/context.vala |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/scores/context.vala b/scores/context.vala
index 03e5ff8..6548e8f 100644
--- a/scores/context.vala
+++ b/scores/context.vala
@@ -327,6 +327,19 @@ public class Context : Object
 
     public bool has_scores ()
     {
+        if (!scores_loaded_from_file)
+        {
+            try
+            {
+                load_scores_from_files ();
+                scores_loaded_from_file = true;
+            }
+            catch (Error e)
+            {
+                warning ("%s", e.message);
+            }
+        }
+
         foreach (var scores in scores_per_category.values)
         {
             if (scores.size > 0)


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