[rygel/config] Don't load disabled plugins



commit 0449734ded2fe9f2545f70abc05e83edae80d475
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Apr 23 19:05:37 2009 +0300

    Don't load disabled plugins
---
 src/rygel/rygel-media-server-factory.vala |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/rygel/rygel-media-server-factory.vala b/src/rygel/rygel-media-server-factory.vala
index b1f93c6..9a09a37 100644
--- a/src/rygel/rygel-media-server-factory.vala
+++ b/src/rygel/rygel-media-server-factory.vala
@@ -27,7 +27,8 @@ using CStuff;
 using Rygel;
 
 public errordomain MediaServerFactoryError {
-    XML_PARSE
+    XML_PARSE,
+    PLUGIN_DISABLED
 }
 
 /**
@@ -50,6 +51,11 @@ public class Rygel.MediaServerFactory {
     }
 
     public MediaServer create_media_server (Plugin plugin) throws GLib.Error {
+        if (!this.config_reader.get_enabled (plugin.name)) {
+            throw new MediaServerFactoryError.PLUGIN_DISABLED (
+                            "Plugin disabled in user configuration.");
+        }
+
         string modified_desc = DESC_PREFIX + "-" + plugin.name + ".xml";
 
         /* We store a modified description.xml in the user's config dir */



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