From d3e29ee84af4a8cfcd1f761896949e0fc5c9e8c0 Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Tue, 11 Nov 2008 18:10:05 +0000 Subject: [PATCH] Avoid using 'construct' now that we have flexible construction methods. svn path=/trunk/; revision=287 --- ChangeLog | 9 +++++++++ src/media-providers/tracker/rygel-media-tracker.vala | 11 ++++------- src/media-server/rygel-media-manager.vala | 16 +++++++--------- src/media-server/rygel-media-server.vala | 20 +++++++++----------- src/media-server/rygel-metadata-extractor.vala | 2 +- 5 files changed, 30 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index bd5c891..a25e254 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2008-11-11 Zeeshan Ali (Khattak) + * src/media-providers/tracker/rygel-media-tracker.vala: + * src/media-server/rygel-media-manager.vala: + * src/media-server/rygel-media-server.vala: + * src/media-server/rygel-metadata-extractor.vala: + + Avoid using 'construct' now that we have flexible construction methods. + +2008-11-11 Zeeshan Ali (Khattak) + * src/media-providers/tracker/rygel-tracker-container.vala: * src/media-providers/tracker/rygel-tracker-image-item.vala: * src/media-providers/tracker/rygel-tracker-item.vala: diff --git a/src/media-providers/tracker/rygel-media-tracker.vala b/src/media-providers/tracker/rygel-media-tracker.vala index 3df7269..acf5e5a 100644 --- a/src/media-providers/tracker/rygel-media-tracker.vala +++ b/src/media-providers/tracker/rygel-media-tracker.vala @@ -36,7 +36,10 @@ public class Rygel.MediaTracker : MediaProvider { private SearchCriteriaParser search_parser; - construct { + /* Pubic methods */ + public MediaTracker (string root_id, + string root_parent_id, + GUPnP.Context context) { this.containers = new List (); this.containers.append (new TrackerContainer (this.root_id + ":" + "16", @@ -74,12 +77,6 @@ public class Rygel.MediaTracker : MediaProvider { /* Host the home dir of the user */ this.context.host_path (home_dir, home_dir); - } - - /* Pubic methods */ - public MediaTracker (string root_id, - string root_parent_id, - GUPnP.Context context) { this.root_id = root_id; this.root_parent_id = root_parent_id; this.title = "Tracker"; diff --git a/src/media-server/rygel-media-manager.vala b/src/media-server/rygel-media-manager.vala index 8aa3ad4..d185e13 100644 --- a/src/media-server/rygel-media-manager.vala +++ b/src/media-server/rygel-media-manager.vala @@ -45,7 +45,13 @@ public class Rygel.MediaManager : MediaProvider { string root_parent_id, GUPnP.Context context); - construct { + /* Pubic methods */ + public MediaManager (GUPnP.Context context) { + this.root_id = "0"; + this.root_parent_id = "-1"; + this.title = "Media Manager"; + this.context = context; + this.providers = new HashTable ((HashFunc) id_hash_func, (EqualFunc) is_root_equal); @@ -61,14 +67,6 @@ public class Rygel.MediaManager : MediaProvider { this.register_media_providers (); } - /* Pubic methods */ - public MediaManager (GUPnP.Context context) { - this.root_id = "0"; - this.root_parent_id = "-1"; - this.title = "Media Manager"; - this.context = context; - } - public override void add_children_metadata (DIDLLiteWriter didl_writer, string container_id, diff --git a/src/media-server/rygel-media-server.vala b/src/media-server/rygel-media-server.vala index f3d1b2f..edffdce 100644 --- a/src/media-server/rygel-media-server.vala +++ b/src/media-server/rygel-media-server.vala @@ -45,7 +45,15 @@ public class Rygel.MediaServer: RootDevice { private ConnectionManager cm; /* ConnectionManager */ private MediaReceiverRegistrar msr; /* MS MediaReceiverRegistrar */ - construct { + public MediaServer (GUPnP.Context context, + Xml.Doc description_doc, + string relative_location) { + this.context = context; + this.resource_factory = GUPnP.ResourceFactory.get_default (); + this.root_device = null; + this.description_doc = description_doc; + this.relative_location = relative_location; + ResourceFactory factory = this.resource_factory; /* Register Rygel.ContentDirectory */ @@ -73,16 +81,6 @@ public class Rygel.MediaServer: RootDevice { (MEDIA_RECEIVER_REGISTRAR); } - public MediaServer (GUPnP.Context context, - Xml.Doc description_doc, - string relative_location) { - this.context = context; - this.resource_factory = GUPnP.ResourceFactory.get_default (); - this.root_device = null; - this.description_doc = description_doc; - this.relative_location = relative_location; - } - public static int main (string[] args) { MediaServer server; MainLoop main_loop; diff --git a/src/media-server/rygel-metadata-extractor.vala b/src/media-server/rygel-metadata-extractor.vala index 9196bb3..dfae6fe 100644 --- a/src/media-server/rygel-metadata-extractor.vala +++ b/src/media-server/rygel-metadata-extractor.vala @@ -81,7 +81,7 @@ public class Rygel.MetadataExtractor: GLib.Object { } } - construct { + public MetadataExtractor () { this.playbin = ElementFactory.make ("playbin", null); var bus = this.playbin.get_bus (); -- 2.7.4