[gnome-games/wip/exalm/views: 92/109] application-window: Pass application in constructor



commit 0f6fea11d9541a3200c8b0f04984a070762a9479
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sun Feb 24 23:31:23 2019 +0500

    application-window: Pass application in constructor

 src/ui/application-window.vala | 4 +++-
 src/ui/application.vala        | 3 +--
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index c606c33c..14a566a8 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -107,7 +107,9 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
 
        private KonamiCode konami_code;
 
-       public ApplicationWindow (ListModel collection) {
+       public ApplicationWindow (Application application, ListModel collection) {
+               Object(application: application);
+
                collection_box.collection = collection;
                collection.items_changed.connect (() => {
                        is_collection_empty = collection.get_n_items () == 0;
diff --git a/src/ui/application.vala b/src/ui/application.vala
index 4dcecb6c..f0f7de2e 100644
--- a/src/ui/application.vala
+++ b/src/ui/application.vala
@@ -234,8 +234,7 @@ public class Games.Application : Gtk.Application {
                        return;
                }
 
-               window = new ApplicationWindow (list_store);
-               this.add_window (window);
+               window = new ApplicationWindow (this, list_store);
                window.destroy.connect (() => {
                        quit_application ();
                });


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