core, server: Plugin: Avoid public setting of some members.
authorMurray Cumming <murrayc@openismus.com>
Tue, 23 Oct 2012 08:02:43 +0000 (10:02 +0200)
committerMurray Cumming <murrayc@murrayc.com>
Thu, 25 Oct 2012 07:22:57 +0000 (09:22 +0200)
This is not necessary so it seems unwise to make it public API
already that cannot be removed later.
This actually changes the access from bare struct access to
GObject properties, allowing us later to respond properly to
changes to the title.
Bug #686682

src/librygel-core/rygel-plugin.vala
src/librygel-server/rygel-media-server-plugin.vala

index 1f72d5c..9e89dc1 100644 (file)
@@ -64,19 +64,19 @@ public class Rygel.Plugin : GUPnP.ResourceFactory {
     private static const int ICON_SMALL_WIDTH = 48;
     private static const int ICON_SMALL_HEIGHT = 48;
 
-    public string name;
-    public string title;
-    public string description;
+    public string name { get; private set; }
+    public string title { get; set; }
+    public string description { get; private set; }
 
     // Path to description document
-    public string desc_path;
+    public string desc_path { get; private set; }
 
     public bool active { get; set; }
 
-    public ArrayList<ResourceInfo> resource_infos;
-    public ArrayList<IconInfo> icon_infos;
+    public ArrayList<ResourceInfo> resource_infos { get; private set; }
+    public ArrayList<IconInfo> icon_infos { get; private set; }
 
-    public ArrayList<IconInfo> default_icons;
+    public ArrayList<IconInfo> default_icons { get; private set; }
 
     /*
      * TODO: Document the format of the template file, such as which tags/attributes
index 5842454..23a9bd7 100644 (file)
@@ -31,7 +31,7 @@ public abstract class Rygel.MediaServerPlugin : Rygel.Plugin {
     private static const string MEDIA_SERVER_DESC_PATH =
                                 BuildConfig.DATA_DIR + "/xml/MediaServer2.xml";
 
-    public MediaContainer root_container;
+    public MediaContainer root_container { get; private set; }
 
     /**
      * Create an instance of the plugin.