Movie list store: use insert_with_values instead of append + set
authorPhilipp Zabel <philipp.zabel@gmail.com>
Thu, 5 Aug 2010 19:03:33 +0000 (21:03 +0200)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Thu, 5 Aug 2010 19:27:00 +0000 (21:27 +0200)
src/movie-list-store.vala

index 2bccf67..c87d1da 100644 (file)
@@ -82,9 +82,11 @@ public class MovieListStore : ListStore, TreeModel {
                }
 
                append (out iter1);
-               base.set (iter1, 0, movie,
-                                1, markup.str,
-                                2, (movie.rating >= 0) ? "%d.%d".printf (movie.rating / 10, movie.rating % 10) : null);
+
+               base.insert_with_values (out iter1, -1,
+                                        0, movie,
+                                        1, markup.str,
+                                        2, (movie.rating >= 0) ? "%.1f".printf (movie.rating / 10.0) : null);
 
                movie.notify.connect (this.on_movie_changed);