projects
/
cinaest
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f27377
)
Movie list store: add remove method
author
Philipp Zabel
<philipp.zabel@gmail.com>
Tue, 17 Nov 2009 22:34:52 +0000
(23:34 +0100)
committer
Philipp Zabel
<philipp.zabel@gmail.com>
Wed, 18 Nov 2009 14:36:49 +0000
(15:36 +0100)
Removes a movie from the list store.
src/movie-list-store.vala
patch
|
blob
|
history
diff --git
a/src/movie-list-store.vala
b/src/movie-list-store.vala
index
68f72dc
..
f9a78ad
100644
(file)
--- a/
src/movie-list-store.vala
+++ b/
src/movie-list-store.vala
@@
-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;