[latexila/gnome-3] Latexila: use GLib.Application.get_default()



commit 0b25c2f8fb4aed2020bd29d82758190653bd0800
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Mon Apr 2 20:42:53 2012 +0200

    Latexila: use GLib.Application.get_default()
    
    The singletion is already managed by GLib.Application.

 src/latexila.vala |    9 ++-------
 src/main.vala     |    2 +-
 2 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/latexila.vala b/src/latexila.vala
index cbabb90..c082931 100644
--- a/src/latexila.vala
+++ b/src/latexila.vala
@@ -21,11 +21,9 @@
 
 public class Latexila : Gtk.Application
 {
-    private static Latexila _instance = null;
-
     public MainWindow active_window { get; private set; }
 
-    private Latexila ()
+    public Latexila ()
     {
         Object (application_id: "org.gnome.latexila");
         Environment.set_application_name ("LaTeXila");
@@ -50,10 +48,7 @@ public class Latexila : Gtk.Application
 
     public static Latexila get_instance ()
     {
-        if (_instance == null)
-            _instance = new Latexila ();
-
-        return _instance;
+        return GLib.Application.get_default () as Latexila;
     }
 
     private void init_primary_instance ()
diff --git a/src/main.vala b/src/main.vala
index 1f066b6..3918824 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -105,6 +105,6 @@ int main (string[] args)
     check_xdg_data_dirs ();
     init_i18n ();
 
-    Latexila app = Latexila.get_instance ();
+    Latexila app = new Latexila ();
     return app.run (args);
 }



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