[rygel] core, server: Plugin: Avoid public setting of some members.



commit cae3405dd711dd5b6c644e0ad356ee96f94a336f
Author: Murray Cumming <murrayc openismus com>
Date:   Tue Oct 23 10:02:43 2012 +0200

    core, server: Plugin: Avoid public setting of some members.
    
    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                |   14 +++++++-------
 src/librygel-server/rygel-media-server-plugin.vala |    2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/librygel-core/rygel-plugin.vala b/src/librygel-core/rygel-plugin.vala
index 1f72d5c..9e89dc1 100644
--- a/src/librygel-core/rygel-plugin.vala
+++ b/src/librygel-core/rygel-plugin.vala
@@ -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
diff --git a/src/librygel-server/rygel-media-server-plugin.vala b/src/librygel-server/rygel-media-server-plugin.vala
index 5842454..23a9bd7 100644
--- a/src/librygel-server/rygel-media-server-plugin.vala
+++ b/src/librygel-server/rygel-media-server-plugin.vala
@@ -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.



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