[rygel] media-export: Notify parent container on removal



commit e868ddf65b93fcb1dfd796ab0bf7f1a6899a0f9b
Author: Jens Georg <mail jensge org>
Date:   Sun Jul 5 13:39:55 2009 +0200

    media-export: Notify parent container on removal

 .../rygel-media-export-root-container.vala         |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala
index 0644e80..8988c37 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -127,7 +127,16 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer {
             case FileMonitorEvent.DELETED:
                 var id = Checksum.compute_for_string (ChecksumType.MD5,
                                                       file.get_uri ());
-                this.media_db.delete_by_id (id);
+                var obj = this.media_db.get_object (id);
+
+                // it may be that files removed are files that are not
+                // in the database, because they're not media files
+                if (obj != null) {
+                    this.media_db.delete_object (obj);
+                    if (obj.parent != null) {
+                        parent.updated ();
+                    }
+                }
                 break;
             default:
                 break;



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