[gnome-weather] Add a global helper to get the application



commit eda81db37416781cc20e957f36e52ca511049cb3
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sun Sep 8 18:45:29 2013 +0200

    Add a global helper to get the application
    
    Replace the "Gio.Application.get_default()" dance with a simple
    getApp()

 src/main.js |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/main.js b/src/main.js
index 858e1d0..33f1d74 100644
--- a/src/main.js
+++ b/src/main.js
@@ -38,6 +38,12 @@ const Window = imports.window;
 const World = imports.world;
 const SearchProvider = imports.searchProvider;
 
+function initEnvironment() {
+    window.getApp = function() {
+        return Gio.Application.get_default();
+    };
+}
+
 const Application = new Lang.Class({
     Name: 'WeatherApplication',
     Extends: Gtk.Application,
@@ -116,5 +122,7 @@ const Application = new Lang.Class({
 });
 
 function main(argv) {
+    initEnvironment();
+
     return (new Application()).run(argv);
 }


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