[rygel/config] ui: Implement removal of folder paths
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Subject: [rygel/config] ui: Implement removal of folder paths
- Date: Tue, 2 Jun 2009 17:21:15 -0400 (EDT)
commit 6b894cc0c2ce62075d58879c456a309845ffa706
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Tue Jun 2 19:35:08 2009 +0300
ui: Implement removal of folder paths
---
src/ui/rygel-folder-pref-section.vala | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/src/ui/rygel-folder-pref-section.vala b/src/ui/rygel-folder-pref-section.vala
index 4e1d811..246cb6d 100644
--- a/src/ui/rygel-folder-pref-section.vala
+++ b/src/ui/rygel-folder-pref-section.vala
@@ -88,6 +88,24 @@ public class Rygel.FolderPrefSection : Rygel.PluginPrefSection {
[CCode (instance_pos = -1)]
public void on_remove_button_clicked (Button button) {
+ var selection = this.treeview.get_selection ();
+ var rows = selection.get_selected_rows (null);
+
+ // First get permanent references to rows
+ var row_refs = new ArrayList<TreeRowReference> ();
+ foreach (var row in rows) {
+ row_refs.add (new TreeRowReference (this.liststore, row));
+ }
+
+ // Now we can safely remove rows
+ foreach (var row_ref in row_refs) {
+ TreeIter iter;
+
+ var path = row_ref.get_path ();
+ this.liststore.get_iter (out iter, path);
+
+ this.liststore.remove (iter);
+ }
}
[CCode (instance_pos = -1)]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]