Drop the custom SQLite3 VAPI
[cinaest] / src / movie-list-store.vala
index 6381028..f9a78ad 100644 (file)
@@ -64,6 +64,23 @@ public class MovieListStore : ListStore, TreeModel {
                iter = iter1;
        }
 
+       public new bool remove (Movie movie) {
+               TreeIter iter;
+
+               if (get_iter_from_movie (out iter, movie)) {
+                       movie.notify.disconnect (this.on_movie_changed);
+                       base.remove (iter);
+
+                       if (source.get_editable ()) {
+                               source.delete_movie (movie);
+                       }
+
+                       return true;
+               }
+
+               return false;
+       }
+
        private void on_movie_changed (GLib.Object source, GLib.ParamSpec spec) {
                var movie = (Movie) source;
 
@@ -74,6 +91,10 @@ public class MovieListStore : ListStore, TreeModel {
                }
        }
 
+       public bool get_editable () {
+               return source.get_editable ();
+       }
+
        public bool get_iter_from_movie (out TreeIter iter, Movie movie_a) {
                if (get_iter_first (out iter)) {
                        do {