[libgames-support] Make some usage errors fatal



commit 3428123d7c74c788c7d57dbdc8fcb918822e441c
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Jun 28 11:44:39 2015 -0500

    Make some usage errors fatal

 games/scores/context.vala |   20 ++++++++++----------
 games/scores/dialog.vala  |    7 +++----
 2 files changed, 13 insertions(+), 14 deletions(-)
---
diff --git a/games/scores/context.vala b/games/scores/context.vala
index e9686ac..b2753e3 100644
--- a/games/scores/context.vala
+++ b/games/scores/context.vala
@@ -198,10 +198,11 @@ public class Context : Object
     {
         if (game_window != null && game_window.visible)
         {
-            warning ("The application window associated with the GamesScoresContext " +
-                     "was set visible before the Context was constructed. The Context " +
-                     "performs synchronous I/O to load scores when it is constructed, " +
-                     "so you should create the Context before showing your main window.");
+            error ("The application window associated with the GamesScoresContext was" +
+                   "was set visible before the Context was constructed. The Context " +
+                   "performs synchronous I/O in the default main context to load " +
+                   "scores when it is constructed, so you should create the Context " +
+                   "before showing your main window.");
         }
 
         var directory = File.new_for_path (user_score_dir);
@@ -219,12 +220,11 @@ public class Context : Object
 
             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::category-request to supply " +
-                         "a GamesScoresCategory.", category_key);
-                continue;
+                error ("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::category-request to supply " +
+                       "a GamesScoresCategory.", category_key);
             }
 
             var filename = Path.build_filename (user_score_dir, category_key);
diff --git a/games/scores/dialog.vala b/games/scores/dialog.vala
index 13beaed..f02028f 100644
--- a/games/scores/dialog.vala
+++ b/games/scores/dialog.vala
@@ -184,10 +184,9 @@ private class Dialog : Gtk.Dialog
         }
         else if (!context.has_scores ())
         {
-            warning ("A GamesScoresDialog was created but no scores exist yet. " +
-                     "Games should not allow this dialog to be created before scores have been added. " +
-                     "Use games_scores_context_has_scores() to determine if this dialog should be 
available.");
-            return;
+            error ("A GamesScoresDialog was created but no scores exist yet. " +
+                   "Games should not allow this dialog to be created before scores have been added. " +
+                   "Use games_scores_context_has_scores() to determine if this dialog should be available.");
         }
 
         if (combo == null)


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