[rygel] server: Remove useless update events



commit 684ea70e3b96a232cfef8a68dd3dec060b61a0e3
Author: Jens Georg <jensg openismus com>
Date:   Thu Jan 10 11:20:26 2013 +0100

    server: Remove useless update events

 src/librygel-server/rygel-trackable-container.vala |    3 +++
 .../media-export/rygel-media-export-harvester.vala |    5 -----
 .../rygel-media-export-harvesting-task.vala        |   10 +---------
 3 files changed, 4 insertions(+), 14 deletions(-)
---
diff --git a/src/librygel-server/rygel-trackable-container.vala b/src/librygel-server/rygel-trackable-container.vala
index 566de68..e22feb4 100644
--- a/src/librygel-server/rygel-trackable-container.vala
+++ b/src/librygel-server/rygel-trackable-container.vala
@@ -61,6 +61,9 @@ public interface Rygel.TrackableContainer : Rygel.MediaContainer {
 
         this.updated (object, ObjectEventType.DELETED);
         this.total_deleted_child_count++;
+
+        // FIXME: Check if modification of child_count should lead to
+        // LastChange event.
         this.updated ();
     }
 
diff --git a/src/plugins/media-export/rygel-media-export-harvester.vala b/src/plugins/media-export/rygel-media-export-harvester.vala
index f0a0a0f..07f93d3 100644
--- a/src/plugins/media-export/rygel-media-export-harvester.vala
+++ b/src/plugins/media-export/rygel-media-export-harvester.vala
@@ -245,11 +245,6 @@ internal class Rygel.MediaExport.Harvester : GLib.Object {
 
                 object = parent;
             }
-
-            if (parent != null) {
-                parent.updated ();
-                cache.save_container (parent);
-            }
         } catch (Error error) {
             warning (_("Error removing object from database: %s"),
                      error.message);
diff --git a/src/plugins/media-export/rygel-media-export-harvesting-task.vala b/src/plugins/media-export/rygel-media-export-harvesting-task.vala
index 037cc5b..c3c8c52 100644
--- a/src/plugins/media-export/rygel-media-export-harvesting-task.vala
+++ b/src/plugins/media-export/rygel-media-export-harvesting-task.vala
@@ -289,10 +289,6 @@ public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine,
                                             this.flag);
                 } catch (Error error) {};
             }
-            parent.updated (parent);
-            try {
-                this.cache.save_container (parent);
-            } catch (Error error) { }
 
             this.completed ();
         }
@@ -378,11 +374,7 @@ public class Rygel.MediaExport.HarvestingTask : Rygel.StateMachine,
             var container = this.containers.peek_head ();
             try {
                 var cache = MediaCache.get_default ();
-                if (cache.get_child_count (container.id) > 0) {
-                    var head = this.containers.peek_head ();
-                    head.updated (head);
-                    cache.save_container (head);
-                } else {
+                if (cache.get_child_count (container.id) == 0) {
                     var parent = container.parent as TrackableContainer;
                     parent.remove_child_tracked.begin (container, () => {
                         try {



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