[rygel/wip/create-reference: 1/5] server: Make it possbile to remove a container



commit b15088ec0a54badb682e1308df8375513002ce9d
Author: Jens Georg <jensg openismus com>
Date:   Fri Apr 12 11:35:24 2013 +0200

    server: Make it possbile to remove a container

 src/librygel-server/rygel-item-destroyer.vala |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/librygel-server/rygel-item-destroyer.vala b/src/librygel-server/rygel-item-destroyer.vala
index 90203cb..3c960a6 100644
--- a/src/librygel-server/rygel-item-destroyer.vala
+++ b/src/librygel-server/rygel-item-destroyer.vala
@@ -75,9 +75,9 @@ internal class Rygel.ItemDestroyer: GLib.Object, Rygel.StateMachine {
 
     private async void remove_object () throws Error {
         var media_object = yield this.fetch_object ();
+        var parent = media_object.parent as WritableContainer;
 
         if (media_object is MediaItem ) {
-            var parent = media_object.parent as WritableContainer;
             yield parent.remove_item (this.object_id, this.cancellable);
 
             if (!(media_object as MediaItem).place_holder) {
@@ -88,6 +88,8 @@ internal class Rygel.ItemDestroyer: GLib.Object, Rygel.StateMachine {
                     }
                 }
             }
+        } else {
+            yield parent.remove_container (this.object_id, this.cancellable);
         }
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]