[rygel] media-export: Change return types of RootContainer's function more useful.



commit 872775b3e66c60a2c30605db572a03aa15ca04f4
Author: Krzesimir Nowak <krnowak openismus com>
Date:   Mon Feb 11 15:53:51 2013 +0100

    media-export: Change return types of RootContainer's function more useful.

 .../rygel-media-export-object-factory.vala         |    6 +++---
 .../media-export/rygel-media-export-plugin.vala    |    3 +--
 .../rygel-media-export-root-container.vala         |    8 ++++----
 3 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-object-factory.vala b/src/plugins/media-export/rygel-media-export-object-factory.vala
index fe8c315..1b62107 100644
--- a/src/plugins/media-export/rygel-media-export-object-factory.vala
+++ b/src/plugins/media-export/rygel-media-export-object-factory.vala
@@ -38,11 +38,11 @@ internal class Rygel.MediaExport.ObjectFactory : Object {
                                               uint       child_count,
                                               string?    uri) {
         if (id == "0") {
-            return RootContainer.get_instance () as DBContainer;
+            return RootContainer.get_instance ();
         } else if (id == RootContainer.FILESYSTEM_FOLDER_ID) {
-            var root_container = RootContainer.get_instance () as RootContainer;
+            var root_container = RootContainer.get_instance ();
 
-            return root_container.get_filesystem_container () as DBContainer;
+            return root_container.get_filesystem_container ();
         }
 
         if (id.has_prefix (QueryContainer.PREFIX)) {
diff --git a/src/plugins/media-export/rygel-media-export-plugin.vala b/src/plugins/media-export/rygel-media-export-plugin.vala
index 977bf50..503f07b 100644
--- a/src/plugins/media-export/rygel-media-export-plugin.vala
+++ b/src/plugins/media-export/rygel-media-export-plugin.vala
@@ -101,8 +101,7 @@ private void shutdown_media_export () {
         var config = MetaConfig.get_default ();
         var enabled = config.get_bool ("MediaExport", "enabled");
         if (enabled) {
-            var root = Rygel.MediaExport.RootContainer.get_instance ()
-                                        as Rygel.MediaExport.RootContainer;
+            var root = Rygel.MediaExport.RootContainer.get_instance ();
 
             root.shutdown ();
         }
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 66925e7..bed6962 100644
--- a/src/plugins/media-export/rygel-media-export-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-root-container.vala
@@ -47,10 +47,10 @@ const Rygel.MediaExport.FolderDefinition[] VIRTUAL_FOLDERS_MUSIC = {
 public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
     private Harvester      harvester;
     private Cancellable    cancellable;
-    private MediaContainer filesystem_container;
+    private DBContainer    filesystem_container;
     private ulong          harvester_signal_id;
 
-    private static MediaContainer instance = null;
+    private static RootContainer instance = null;
 
     internal const string FILESYSTEM_FOLDER_NAME = N_("Files & Folders");
     internal const string FILESYSTEM_FOLDER_ID   = "Filesystem";
@@ -70,11 +70,11 @@ public class Rygel.MediaExport.RootContainer : TrackableDbContainer {
     /**
      * Get the single instance of the root container.
      */
-    public static MediaContainer get_instance () {
+    public static RootContainer get_instance () {
         return RootContainer.instance;
     }
 
-    public MediaContainer get_filesystem_container () {
+    public DBContainer get_filesystem_container () {
         return this.filesystem_container;
     }
 


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