[mutter] meta-plugin: Remove "disabled" feature



commit 574c0c32875916d94433f49a129ac79b12d0422c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Apr 5 01:25:46 2012 -0400

    meta-plugin: Remove "disabled" feature
    
    It's just code cruft that nobody's using
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676855

 src/compositor/meta-plugin-manager.c |  133 ++++++++++++++++------------------
 src/compositor/meta-plugin.c         |   24 ------
 src/meta/meta-plugin.h               |    1 -
 3 files changed, 61 insertions(+), 97 deletions(-)
---
diff --git a/src/compositor/meta-plugin-manager.c b/src/compositor/meta-plugin-manager.c
index f23e17f..8f03805 100644
--- a/src/compositor/meta-plugin-manager.c
+++ b/src/compositor/meta-plugin-manager.c
@@ -205,8 +205,7 @@ meta_plugin_manager_kill_window_effects (MetaPluginManager *plugin_mgr,
       MetaPlugin        *plugin = l->data;
       MetaPluginClass   *klass = META_PLUGIN_GET_CLASS (plugin);
 
-      if (!meta_plugin_disabled (plugin)
-	  && klass->kill_window_effects)
+      if (klass->kill_window_effects)
         klass->kill_window_effects (plugin, actor);
 
       l = l->next;
@@ -223,7 +222,7 @@ meta_plugin_manager_kill_switch_workspace (MetaPluginManager *plugin_mgr)
       MetaPlugin        *plugin = l->data;
       MetaPluginClass   *klass = META_PLUGIN_GET_CLASS (plugin);
 
-      if (!meta_plugin_disabled (plugin) && klass->kill_switch_workspace)
+      if (klass->kill_switch_workspace)
         klass->kill_switch_workspace (plugin);
 
       l = l->next;
@@ -256,45 +255,40 @@ meta_plugin_manager_event_simple (MetaPluginManager *plugin_mgr,
       MetaPlugin        *plugin = l->data;
       MetaPluginClass   *klass = META_PLUGIN_GET_CLASS (plugin);
 
-      if (!meta_plugin_disabled (plugin))
+      switch (event)
         {
-          switch (event)
+        case META_PLUGIN_MINIMIZE:
+          if (klass->minimize)
             {
-            case META_PLUGIN_MINIMIZE:
-              if (klass->minimize)
-                {
-                  retval = TRUE;
-                  meta_plugin_manager_kill_window_effects (
-		      plugin_mgr,
-		      actor);
-
-                  _meta_plugin_effect_started (plugin);
-                  klass->minimize (plugin, actor);
-                }
-              break;
-            case META_PLUGIN_MAP:
-              if (klass->map)
-                {
-                  retval = TRUE;
-                  meta_plugin_manager_kill_window_effects (
-		      plugin_mgr,
-		      actor);
-
-                  _meta_plugin_effect_started (plugin);
-                  klass->map (plugin, actor);
-                }
-              break;
-            case META_PLUGIN_DESTROY:
-              if (klass->destroy)
-                {
-                  retval = TRUE;
-                  _meta_plugin_effect_started (plugin);
-                  klass->destroy (plugin, actor);
-                }
-              break;
-            default:
-              g_warning ("Incorrect handler called for event %lu", event);
+              retval = TRUE;
+              meta_plugin_manager_kill_window_effects (plugin_mgr,
+                                                       actor);
+
+              _meta_plugin_effect_started (plugin);
+              klass->minimize (plugin, actor);
+            }
+          break;
+        case META_PLUGIN_MAP:
+          if (klass->map)
+            {
+              retval = TRUE;
+              meta_plugin_manager_kill_window_effects (plugin_mgr,
+                                                       actor);
+
+              _meta_plugin_effect_started (plugin);
+              klass->map (plugin, actor);
             }
+          break;
+        case META_PLUGIN_DESTROY:
+          if (klass->destroy)
+            {
+              retval = TRUE;
+              _meta_plugin_effect_started (plugin);
+              klass->destroy (plugin, actor);
+            }
+          break;
+        default:
+          g_warning ("Incorrect handler called for event %lu", event);
         }
 
       l = l->next;
@@ -333,41 +327,36 @@ meta_plugin_manager_event_maximize (MetaPluginManager *plugin_mgr,
       MetaPlugin        *plugin = l->data;
       MetaPluginClass   *klass = META_PLUGIN_GET_CLASS (plugin);
 
-      if (!meta_plugin_disabled (plugin))
+      switch (event)
         {
-          switch (event)
+        case META_PLUGIN_MAXIMIZE:
+          if (klass->maximize)
+            {
+              retval = TRUE;
+              meta_plugin_manager_kill_window_effects (plugin_mgr,
+                                                       actor);
+
+              _meta_plugin_effect_started (plugin);
+              klass->maximize (plugin, actor,
+                               target_x, target_y,
+                               target_width, target_height);
+            }
+          break;
+        case META_PLUGIN_UNMAXIMIZE:
+          if (klass->unmaximize)
             {
-            case META_PLUGIN_MAXIMIZE:
-              if (klass->maximize)
-                {
-                  retval = TRUE;
-                  meta_plugin_manager_kill_window_effects (
-		      plugin_mgr,
-		      actor);
-
-                  _meta_plugin_effect_started (plugin);
-                  klass->maximize (plugin, actor,
-                                   target_x, target_y,
-                                   target_width, target_height);
-                }
-              break;
-            case META_PLUGIN_UNMAXIMIZE:
-              if (klass->unmaximize)
-                {
-                  retval = TRUE;
-                  meta_plugin_manager_kill_window_effects (
-		      plugin_mgr,
-		      actor);
-
-                  _meta_plugin_effect_started (plugin);
-                  klass->unmaximize (plugin, actor,
-                                     target_x, target_y,
-                                     target_width, target_height);
-                }
-              break;
-            default:
-              g_warning ("Incorrect handler called for event %lu", event);
+              retval = TRUE;
+              meta_plugin_manager_kill_window_effects (plugin_mgr,
+                                                       actor);
+
+              _meta_plugin_effect_started (plugin);
+              klass->unmaximize (plugin, actor,
+                                 target_x, target_y,
+                                 target_width, target_height);
             }
+          break;
+        default:
+          g_warning ("Incorrect handler called for event %lu", event);
         }
 
       l = l->next;
@@ -402,7 +391,7 @@ meta_plugin_manager_switch_workspace (MetaPluginManager   *plugin_mgr,
       MetaPlugin        *plugin = l->data;
       MetaPluginClass   *klass = META_PLUGIN_GET_CLASS (plugin);
 
-      if (!meta_plugin_disabled (plugin) && klass->switch_workspace)
+      if (klass->switch_workspace)
         {
           retval = TRUE;
           meta_plugin_manager_kill_switch_workspace (plugin_mgr);
diff --git a/src/compositor/meta-plugin.c b/src/compositor/meta-plugin.c
index 840e3ae..fa4e6d6 100644
--- a/src/compositor/meta-plugin.c
+++ b/src/compositor/meta-plugin.c
@@ -44,7 +44,6 @@ enum
 {
   PROP_0,
   PROP_SCREEN,
-  PROP_DISABLED,
   PROP_DEBUG_MODE,
 };
 
@@ -54,7 +53,6 @@ struct _MetaPluginPrivate
 
   gint          running;
 
-  gboolean      disabled : 1;
   gboolean      debug    : 1;
 };
 
@@ -71,9 +69,6 @@ meta_plugin_set_property (GObject      *object,
     case PROP_SCREEN:
       priv->screen = g_value_get_object (value);
       break;
-    case PROP_DISABLED:
-      priv->disabled = g_value_get_boolean (value);
-      break;
     case PROP_DEBUG_MODE:
       priv->debug = g_value_get_boolean (value);
       break;
@@ -96,9 +91,6 @@ meta_plugin_get_property (GObject    *object,
     case PROP_SCREEN:
       g_value_set_object (value, priv->screen);
       break;
-    case PROP_DISABLED:
-      g_value_set_boolean (value, priv->disabled);
-      break;
     case PROP_DEBUG_MODE:
       g_value_set_boolean (value, priv->debug);
       break;
@@ -126,14 +118,6 @@ meta_plugin_class_init (MetaPluginClass *klass)
                                                         G_PARAM_READWRITE));
 
   g_object_class_install_property (gobject_class,
-				   PROP_DISABLED,
-				   g_param_spec_boolean ("disabled",
-                                                      "Plugin disabled",
-                                                      "Plugin disabled",
-                                                      FALSE,
-                                                      G_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
 				   PROP_DEBUG_MODE,
 				   g_param_spec_boolean ("debug-mode",
                                                       "Debug Mode",
@@ -153,14 +137,6 @@ meta_plugin_init (MetaPlugin *self)
 }
 
 gboolean
-meta_plugin_disabled (MetaPlugin *plugin)
-{
-  MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
-
-  return priv->disabled;
-}
-
-gboolean
 meta_plugin_running  (MetaPlugin *plugin)
 {
   MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
diff --git a/src/meta/meta-plugin.h b/src/meta/meta-plugin.h
index 8dae83a..d85f71a 100644
--- a/src/meta/meta-plugin.h
+++ b/src/meta/meta-plugin.h
@@ -123,7 +123,6 @@ struct _MetaPluginInfo
 
 GType meta_plugin_get_type (void);
 
-gboolean      meta_plugin_disabled            (MetaPlugin *plugin);
 gboolean      meta_plugin_running             (MetaPlugin *plugin);
 gboolean      meta_plugin_debug_mode          (MetaPlugin *plugin);
 



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