[gnome-boxes] app, collection: Don't directly populate the views



commit 5ef3372fa575db4b1f8d13fe58a6766d93bbe599
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Jan 4 13:48:20 2018 +0100

    app, collection: Don't directly populate the views
    
    We no longer need to populate ListView and IconView since now their
    children are directly binded from the Collection model.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791839

 src/app.vala        |    6 ------
 src/collection.vala |    5 -----
 2 files changed, 0 insertions(+), 11 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index 600fa91..df84cd4 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -591,7 +591,6 @@ private class Boxes.App: Gtk.Application {
             return quit_app ();
 
         var initial_windows_count = windows.length ();
-        bool window_was_main = (window == main_window);
 
         if (window.current_item != null)
             (window.current_item as Machine).window = null;
@@ -601,11 +600,6 @@ private class Boxes.App: Gtk.Application {
         windows.remove (window);
         base.remove_window (window);
 
-        // If the main window have been removed,
-        // populate the new main window's collection view.
-        if (window_was_main)
-            main_window.foreach_view ((view) => { collection.populate (view); });
-
         notify_property ("main-window");
 
         return initial_windows_count != windows.length ();
diff --git a/src/collection.vala b/src/collection.vala
index 15f4bf3..e877dac 100644
--- a/src/collection.vala
+++ b/src/collection.vala
@@ -105,11 +105,6 @@ private class Boxes.Collection: GLib.Object {
         }
     }
 
-    public void populate (ICollectionView view) {
-        for (int i = 0 ; i < length ; i++)
-            view.add_item (get_item (i));
-    }
-
     public void foreach_item (CollectionForeachFunc foreach_func) {
         for (int i = 0 ; i < length ; i++)
             foreach_func (get_item (i));


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