core: Use name of the plugin rather than ContentDir
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Mon, 2 Aug 2010 16:54:38 +0000 (19:54 +0300)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Mon, 2 Aug 2010 16:54:38 +0000 (19:54 +0300)
We now have only one ContentDirectory implementation so its name is not
unique amongst the plugins so better use the name of the plugin itself.

src/rygel/rygel-content-directory.vala

index adfb2e5..9fa0752 100644 (file)
@@ -67,10 +67,13 @@ public class Rygel.ContentDirectory: Service {
 
     public override void constructed () {
         this.cancellable = new Cancellable ();
-        this.root_container = this.get_root_container ();
+
+        var plugin = this.root_device.resource_factory as MediaServerPlugin;
+
+        this.root_container = plugin.get_root_container (this);
 
         try {
-            this.http_server = new HTTPServer (this, this.get_type ().name ());
+            this.http_server = new HTTPServer (this, plugin.name);
         } catch (GLib.Error err) {
             critical (_("Failed to create HTTP server for %s: %s"),
                       this.get_type ().name (),
@@ -130,12 +133,6 @@ public class Rygel.ContentDirectory: Service {
         this.http_server.run.begin ();
     }
 
-    private MediaContainer get_root_container () {
-        var plugin = this.root_device.resource_factory as MediaServerPlugin;
-
-        return plugin.get_root_container (this);
-    }
-
     ~ContentDirectory () {
         // Cancel all state machines
         this.cancellable.cancel ();