Don't load disabled plugins
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 23 Apr 2009 16:05:37 +0000 (19:05 +0300)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 23 Apr 2009 16:05:37 +0000 (19:05 +0300)
src/rygel/rygel-media-server-factory.vala

index b1f93c6..9a09a37 100644 (file)
@@ -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 */