Movie list store: hold a reference to the view and freeze when updating
authorPhilipp Zabel <philipp.zabel@gmail.com>
Thu, 5 Aug 2010 18:25:36 +0000 (20:25 +0200)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Thu, 5 Aug 2010 19:27:00 +0000 (21:27 +0200)
src/movie-list-store.vala
src/movie-list-view.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) {
index d92a535..d469148 100644 (file)
@@ -163,6 +163,7 @@ public class MovieListView : PannableArea {
                }
 
                tree = create_treeview (window, show_date);
+               store.view = (Widget) tree;
 
                icons = create_iconview ();