[rygel] core,plugins: Rename Plugin.available to active



commit a3a6b850021b061170c07360e3b41315fe9dec6c
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Fri Dec 24 03:50:47 2010 +0200

    core,plugins: Rename Plugin.available to active

 .../external/rygel-external-plugin-factory.vala    |    8 ++++----
 .../media-export/rygel-media-export-plugin.vala    |   12 ++++++------
 src/plugins/mpris/rygel-mpris-plugin-factory.vala  |    8 ++++----
 src/rygel/rygel-main.vala                          |   10 +++++-----
 src/rygel/rygel-plugin.vala                        |    4 ++--
 5 files changed, 21 insertions(+), 21 deletions(-)
---
diff --git a/src/plugins/external/rygel-external-plugin-factory.vala b/src/plugins/external/rygel-external-plugin-factory.vala
index 6c7d81b..4384a2b 100644
--- a/src/plugins/external/rygel-external-plugin-factory.vala
+++ b/src/plugins/external/rygel-external-plugin-factory.vala
@@ -92,12 +92,12 @@ public class Rygel.External.PluginFactory {
 
         if (plugin != null) {
             if (old_owner != "" && new_owner == "") {
-                debug ("Service '%s' going down, marking it as unavailable",
+                debug ("Service '%s' going down, deactivating it",
                        name);
-                plugin.available = false;
+                plugin.active = false;
             } else if (old_owner == "" && new_owner != "") {
-                debug ("Service '%s' up again, marking it as available", name);
-                plugin.available = true;
+                debug ("Service '%s' up again, activating it", name);
+                plugin.active = true;
             }
         } else if (name.has_prefix (SERVICE_PREFIX)) {
             // Ah, new plugin available, lets use it
diff --git a/src/plugins/media-export/rygel-media-export-plugin.vala b/src/plugins/media-export/rygel-media-export-plugin.vala
index 1774b16..9b0d94c 100644
--- a/src/plugins/media-export/rygel-media-export-plugin.vala
+++ b/src/plugins/media-export/rygel-media-export-plugin.vala
@@ -48,9 +48,9 @@ public void module_init (PluginLoader loader) {
 
 public void on_plugin_available (Plugin plugin, Plugin our_plugin) {
     if (plugin.name == TRACKER_PLUGIN &&
-        our_plugin.available == plugin.available) {
-        if (plugin.available) {
-            message ("Disabling plugin '%s' in favor of plugin '%s'",
+        our_plugin.active == plugin.active) {
+        if (plugin.active) {
+            message ("Deactivating plugin '%s' in favor of plugin '%s'",
                      OUR_PLUGIN,
                      TRACKER_PLUGIN);
             try {
@@ -64,12 +64,12 @@ public void on_plugin_available (Plugin plugin, Plugin our_plugin) {
                 }
             } catch (Error error) {};
         } else {
-            message ("Plugin '%s' disabled, enabling '%s' plugin",
+            message ("Plugin '%s' inactivate, activating '%s' plugin",
                      TRACKER_PLUGIN,
                      OUR_PLUGIN);
         }
 
-        our_plugin.available = !plugin.available;
+        our_plugin.active = !plugin.active;
     }
 }
 
@@ -85,7 +85,7 @@ public class Rygel.MediaExport.Plugin : Rygel.MediaServerPlugin {
             warning ("Could not create root container: %s. " +
                      "Disabling plugin",
                      error.message);
-            this.available = false;
+            this.active = false;
         }
 
         return new NullContainer ();
diff --git a/src/plugins/mpris/rygel-mpris-plugin-factory.vala b/src/plugins/mpris/rygel-mpris-plugin-factory.vala
index eaed555..f5f2674 100644
--- a/src/plugins/mpris/rygel-mpris-plugin-factory.vala
+++ b/src/plugins/mpris/rygel-mpris-plugin-factory.vala
@@ -92,12 +92,12 @@ public class Rygel.MPRIS.PluginFactory {
 
         if (plugin != null) {
             if (old_owner != "" && new_owner == "") {
-                debug ("Service '%s' going down, marking it as unavailable",
+                debug ("Service '%s' going down, Deactivating it",
                        name);
-                plugin.available = false;
+                plugin.active = false;
             } else if (old_owner == "" && new_owner != "") {
-                debug ("Service '%s' up again, marking it as available", name);
-                plugin.available = true;
+                debug ("Service '%s' up again, activating it", name);
+                plugin.active = true;
             }
         } else if (name.has_prefix (SERVICE_PREFIX)) {
             // Ah, new plugin available, lets use it
diff --git a/src/rygel/rygel-main.vala b/src/rygel/rygel-main.vala
index b298410..fe417e5 100644
--- a/src/rygel/rygel-main.vala
+++ b/src/rygel/rygel-main.vala
@@ -184,11 +184,11 @@ public class Rygel.Main : Object {
         try {
             var device = factory.create (plugin);
 
-            device.available = plugin.available;
+            device.available = plugin.active;
 
             this.root_devices.add (device);
 
-            plugin.notify["available"].connect (this.on_plugin_notify);
+            plugin.notify["active"].connect (this.on_plugin_active_notify);
         } catch (GLib.Error error) {
             warning (_("Failed to create RootDevice for %s. Reason: %s"),
                      plugin.name,
@@ -196,13 +196,13 @@ public class Rygel.Main : Object {
         }
     }
 
-    private void on_plugin_notify (Object    obj,
-                                   ParamSpec spec) {
+    private void on_plugin_active_notify (Object    obj,
+                                          ParamSpec spec) {
         var plugin = obj as Plugin;
 
         foreach (var device in this.root_devices) {
             if (device.resource_factory == plugin) {
-                device.available = plugin.available;
+                device.available = plugin.active;
             }
         }
     }
diff --git a/src/rygel/rygel-plugin.vala b/src/rygel/rygel-plugin.vala
index ec41045..261cb83 100644
--- a/src/rygel/rygel-plugin.vala
+++ b/src/rygel/rygel-plugin.vala
@@ -62,7 +62,7 @@ public class Rygel.Plugin : GUPnP.ResourceFactory {
     // Path to description document
     public string desc_path;
 
-    public bool available { get; set; }
+    public bool active { get; set; }
 
     public ArrayList<ResourceInfo> resource_infos;
     public ArrayList<IconInfo> icon_infos;
@@ -78,7 +78,7 @@ public class Rygel.Plugin : GUPnP.ResourceFactory {
         this.title = title;
         this.description = description;
 
-        this.available = true;
+        this.active = true;
 
         if (title == null) {
             this.title = name;



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