[gnome-games] gnotravex: Tidy up app menu code



commit 3da1a62d6a87330250e8bba76e2e4a57c3fd9282
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue Feb 7 16:38:17 2012 +1100

    gnotravex: Tidy up app menu code

 gnotravex/src/gnotravex.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gnotravex/src/gnotravex.vala b/gnotravex/src/gnotravex.vala
index 4b99a26..eb551a8 100644
--- a/gnotravex/src/gnotravex.vala
+++ b/gnotravex/src/gnotravex.vala
@@ -41,16 +41,16 @@ public class Gnotravex : Gtk.Application
         pause = lookup_action ("pause") as SimpleAction;
         solve = lookup_action ("solve") as SimpleAction;
 
+        var builder = new Gtk.Builder ();
         try
         {
-            var builder = new Gtk.Builder ();
             builder.add_from_file (Path.build_filename (DATA_DIRECTORY, "gnotravex.ui"));
-            set_app_menu ((MenuModel)builder.get_object ("gnotravex-menu"));
         }
         catch (Error e)
         {
             error ("Unable to build menus: %s", e.message);
         }
+        set_app_menu (builder.get_object ("gnotravex-menu") as MenuModel);
 
         settings = new Settings ("org.gnome.gnotravex");
 



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