[rygel] media-db,media-export: Remove save_object



commit 6f9e5d2546248d82458cf7b3f9458138d336fe51
Author: Jens Georg <mail jensge org>
Date:   Sun Jan 31 17:04:47 2010 +0100

    media-db,media-export: Remove save_object

 .../media-export/rygel-media-export-harvester.vala |    6 +++---
 .../rygel-media-export-root-container.vala         |    4 ++--
 src/rygel/rygel-media-db.vala                      |   10 ----------
 3 files changed, 5 insertions(+), 15 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-harvester.vala b/src/plugins/media-export/rygel-media-export-harvester.vala
index eb9f320..4632db8 100644
--- a/src/plugins/media-export/rygel-media-export-harvester.vala
+++ b/src/plugins/media-export/rygel-media-export-harvester.vala
@@ -127,7 +127,7 @@ public class Rygel.MediaExportHarvester : GLib.Object {
                     int64 timestamp;
                     if (!this.media_db.exists (container.id,
                                                out timestamp)) {
-                        this.media_db.save_object (container);
+                        this.media_db.save_container (container);
                     }
                 } catch (Error err) {
                     warning ("Failed to update database: %s",
@@ -251,7 +251,7 @@ public class Rygel.MediaExportHarvester : GLib.Object {
 
                 int64 timestamp;
                 if (!this.media_db.exists (container.id, out timestamp)) {
-                    this.media_db.save_object (container);
+                    this.media_db.save_container (container);
                 }
 
                 Idle.add (this.on_idle);
@@ -298,7 +298,7 @@ public class Rygel.MediaExportHarvester : GLib.Object {
                     if (entry.update) {
                         this.media_db.update_object (item);
                     } else {
-                        this.media_db.save_object (item);
+                        this.media_db.save_item (item);
                     }
                 } catch (Error error) {
                     // Ignore it for now
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 12b94c7..6eeecb2 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -167,11 +167,11 @@ public class Rygel.MediaExportRootContainer : Rygel.MediaDBContainer {
         try {
             int64 timestamp;
             if (!this.media_db.exists ("0", out timestamp)) {
-                media_db.save_object (this);
+                media_db.save_container (this);
             }
 
             if (!this.media_db.exists ("DynamicContainerId", out timestamp)) {
-                media_db.save_object (this.dynamic_elements);
+                media_db.save_container (this.dynamic_elements);
             }
         } catch (Error error) {
             // do nothing
diff --git a/src/rygel/rygel-media-db.vala b/src/rygel/rygel-media-db.vala
index 6708e00..4f9b482 100644
--- a/src/rygel/rygel-media-db.vala
+++ b/src/rygel/rygel-media-db.vala
@@ -260,16 +260,6 @@ public class Rygel.MediaDB : Object {
         }
     }
 
-    public void save_object (MediaObject obj) throws Error {
-        if (obj is MediaItem) {
-            save_item ((MediaItem)obj);
-        } else if (obj is MediaContainer) {
-            save_container ((MediaContainer)obj);
-        } else {
-            throw new MediaDBError.INVALID_TYPE ("Invalid object type");
-        }
-    }
-
     public void save_container (MediaContainer container) throws Error {
         try {
             db.begin ();



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