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);
markup.append_printf (year_markup, movie.year);
}
- 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, rating_string (movie.rating));
movie.notify.connect (this.on_movie_changed);
iter = iter1;
}
+ private string? rating_string (int rating) {
+ if (rating >= 0) {
+ return "%d.%d".printf (rating / 10,
+ rating % 10);
+ } else {
+ return null;
+ }
+ }
+
public new bool remove (Movie movie) {
TreeIter iter;
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) {