core: RootDevice to GObject-style
authorJens Georg <jensg@openismus.com>
Thu, 6 Dec 2012 22:14:47 +0000 (23:14 +0100)
committerJens Georg <jensg@openismus.com>
Tue, 22 Jan 2013 14:10:08 +0000 (15:10 +0100)
src/librygel-core/rygel-root-device.vala

index b3d5385..e9b58f5 100644 (file)
@@ -50,19 +50,19 @@ public class Rygel.RootDevice: GUPnP.RootDevice {
                 description_doc : description_doc,
                 description_path: description_path,
                 description_dir: description_dir);
+    }
 
-        // Yes, this can happen.
-        if (this != null) {
-            this.services = new ArrayList<ServiceInfo> ();
+    public override void constructed () {
+        this.services = new ArrayList<ServiceInfo> ();
+        var plugin = this.resource_factory as Plugin;
 
-            // Now create the sevice objects
-            foreach (ResourceInfo info in plugin.resource_infos) {
-                // FIXME: We only support plugable services for now
-                if (info.type.is_a (typeof (Service))) {
-                    var service = this.get_service (info.upnp_type);
+        // Now create the sevice objects
+        foreach (var info in plugin.resource_infos) {
+            // FIXME: We only support plugable services for now
+            if (info.type.is_a (typeof (Service))) {
+                var service = this.get_service (info.upnp_type);
 
-                    this.services.add (service);
-                }
+                this.services.add (service);
             }
         }
     }