Movie list store: hold a reference to the view and freeze when updating
[cinaest] / src / movie-list-store.vala
index b7c85e2..2bccf67 100644 (file)
@@ -49,6 +49,7 @@ public class MovieListStore : ListStore, TreeModel {
        public bool update_running { get; set; }
        public string year_markup = "<span size=\"small\">[%d]</span>";
        private Cancellable cancellable;
+       public Widget view;
 
        public signal void search_finished (int movies);
 
@@ -181,8 +182,10 @@ public class MovieListStore : ListStore, TreeModel {
                if (cancellable.is_cancelled ())
                        return;
 
+               view.freeze_child_notify ();
                foreach (Movie movie in movies)
                        add (movie, out iter);
+               view.thaw_child_notify ();
        }
 
        private void receive_poster_icon (Gdk.Pixbuf pixbuf, Movie movie) {