[rygel/wip/track-changes: 16/18] fixup! wip: Add automatic change tracking



commit 36c3d5be674aaabaf777dcbd65dec7409097b6b4
Author: Jens Georg <jensg openismus com>
Date:   Sun Oct 21 18:52:20 2012 +0200

    fixup! wip: Add automatic change tracking

 src/librygel-server/rygel-content-directory.vala   |    8 +++++++-
 src/librygel-server/rygel-media-container.vala     |    2 ++
 src/librygel-server/rygel-trackable-container.vala |   20 ++++++++++++++++++++
 3 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/src/librygel-server/rygel-content-directory.vala b/src/librygel-server/rygel-content-directory.vala
index bfa3f7c..123d321 100644
--- a/src/librygel-server/rygel-content-directory.vala
+++ b/src/librygel-server/rygel-content-directory.vala
@@ -400,7 +400,13 @@ internal class Rygel.ContentDirectory: Service {
                                        bool sub_tree_update) {
         this.add_last_change_entry (object, event_type, sub_tree_update);
         this.system_update_id++;
-        updated_container.update_id = this.system_update_id++;
+
+        if (event_type == ObjectEventType.ADDED ||
+            event_type == ObjectEventType.DELETED) {
+            updated_container.update_id = this.system_update_id;
+        } else {
+            object.object_update_id = this.system_update_id;
+        }
 
         if (this.clear_updated_containers) {
             this.updated_containers.clear ();
diff --git a/src/librygel-server/rygel-media-container.vala b/src/librygel-server/rygel-media-container.vala
index b6f42c3..0450db9 100644
--- a/src/librygel-server/rygel-media-container.vala
+++ b/src/librygel-server/rygel-media-container.vala
@@ -206,6 +206,8 @@ public abstract class Rygel.MediaContainer : MediaObject {
         didl_container.searchable = this is SearchableContainer;
         didl_container.storage_used = this.storage_used;
         if (this is TrackableContainer) {
+            didl_container.container_update_id = this.update_id;
+            didl_container.update_id = this.object_update_id;
             didl_container.total_deleted_child_count =
                                         (uint) this.total_deleted_child_count;
         }
diff --git a/src/librygel-server/rygel-trackable-container.vala b/src/librygel-server/rygel-trackable-container.vala
index cd0a214..952d7a4 100644
--- a/src/librygel-server/rygel-trackable-container.vala
+++ b/src/librygel-server/rygel-trackable-container.vala
@@ -1,3 +1,23 @@
+/*
+ * Copyright (C) 2012 Intel Corporation.
+ *
+ * Author: Jens Georg <jensg openismus come
+ *
+ * Rygel is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
 public interface Rygel.TrackableContainer : Rygel.MediaContainer {
     public async void clear () {
         try {



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