[gnome-maps] mainWindow: Make file chooser instance a property on "this"



commit d4258de733b205e8f2318b46a189bb71187edc6b
Author: Marcus Lundblad <ml update uu se>
Date:   Sun Sep 23 22:02:55 2018 +0200

    mainWindow: Make file chooser instance a property on "this"
    
    Closes #127

 src/mainWindow.js | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 1d5cd2e..1c89f7e 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -554,17 +554,17 @@ var MainWindow = GObject.registerClass({
     }
 
     _onOpenShapeLayer() {
-        let fileChooser = new ShapeLayerFileChooser({
+        this._fileChooser = new ShapeLayerFileChooser({
             transient_for: this,
         });
 
-        fileChooser.connect('response', (widget, response) => {
+        this._fileChooser.connect('response', (widget, response) => {
             if (response === Gtk.ResponseType.ACCEPT) {
-                this._mapView.openShapeLayers(fileChooser.get_files());
+                this._mapView.openShapeLayers(this._fileChooser.get_files());
                 this.layersPopover.popdown();
             }
-            fileChooser.destroy();
+            this._fileChooser.destroy();
         });
-        fileChooser.show();
+        this._fileChooser.show();
     }
 });


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