[gnome-games] lightsoff: Use correct GtkApplication API



commit b5a2f57a617c2fc65b378a034e471e762bcf33a5
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon Feb 20 16:01:30 2012 +1100

    lightsoff: Use correct GtkApplication API

 lightsoff/src/lightsoff.vala |   22 +++++++++-------------
 1 files changed, 9 insertions(+), 13 deletions(-)
---
diff --git a/lightsoff/src/lightsoff.vala b/lightsoff/src/lightsoff.vala
index fd8f588..0874950 100644
--- a/lightsoff/src/lightsoff.vala
+++ b/lightsoff/src/lightsoff.vala
@@ -5,10 +5,15 @@ public class LightsOff : Gtk.Application
     private Gtk.Window window;
     private GameView game_view;
     
-    private LightsOff () throws Error
+    private LightsOff ()
     {
         Object (application_id: "org.gnome.lightsoff", flags: ApplicationFlags.FLAGS_NONE);
-        
+    }
+    
+    protected override void startup ()
+    {
+        base.startup ();
+
         settings = new Settings ("org.gnome.lightsoff");
 
         ui = new Gtk.Builder();
@@ -165,16 +170,7 @@ public class LightsOff : Gtk.Application
 
         GnomeGamesSupport.stock_init ();
 
-        LightsOff app;
-        try
-        {
-            app = new LightsOff ();
-            return app.run ();
-        }
-        catch (Error e)
-        {
-            warning ("Failed to create application: %s", e.message);
-            return Posix.EXIT_FAILURE;
-        }
+        var app = new LightsOff ();
+        return app.run ();
     }
 }



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