[gnome-panel] panel: Drop migration code for lock-object and logout-object (pre-2.2)



commit e57b3afd9255671789ea6c1b6136bbad82573cdc
Author: Vincent Untz <vuntz gnome org>
Date:   Wed Mar 23 10:54:05 2011 +0100

    panel: Drop migration code for lock-object and logout-object (pre-2.2)

 gnome-panel/applet.c              |   14 -------------
 gnome-panel/panel-action-button.c |   38 ++----------------------------------
 gnome-panel/panel-action-button.h |    7 ------
 gnome-panel/panel-enums.h         |    5 +---
 gnome-panel/panel-profile.c       |    3 --
 5 files changed, 4 insertions(+), 63 deletions(-)
---
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index b8478a3..6479e02 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -65,8 +65,6 @@ panel_applet_set_dnd_enabled (AppletInfo *info,
 		break;
 	case PANEL_OBJECT_APPLET:
 		break;
-	case PANEL_OBJECT_LOGOUT:
-	case PANEL_OBJECT_LOCK:
 	case PANEL_OBJECT_ACTION:
 		panel_action_button_set_dnd_enabled (PANEL_ACTION_BUTTON (info->widget),
 						     dnd_enabled);
@@ -284,8 +282,6 @@ applet_callback_callback (GtkWidget      *widget,
 			PANEL_MENU_BUTTON (menu->info->widget), menu->name);
 		break;
 	case PANEL_OBJECT_ACTION:
-	case PANEL_OBJECT_LOGOUT:
-	case PANEL_OBJECT_LOCK:
 		panel_action_button_invoke_menu (
 			PANEL_ACTION_BUTTON (menu->info->widget), menu->name);
 		break;
@@ -1038,16 +1034,6 @@ panel_applet_load_idle_handler (gpointer dummy)
 					  applet->position,
 					  applet->id);
 		break;
-	case PANEL_OBJECT_LOGOUT:
-	case PANEL_OBJECT_LOCK:
-		panel_action_button_load_compatible (
-				applet->type,
-				panel_widget,
-				applet->locked,
-				applet->position,
-				TRUE,
-				applet->id);
-		break;
 	case PANEL_OBJECT_ACTION:
 		panel_action_button_load_from_gconf (
 				panel_widget,
diff --git a/gnome-panel/panel-action-button.c b/gnome-panel/panel-action-button.c
index b614a2b..413acbd 100644
--- a/gnome-panel/panel-action-button.c
+++ b/gnome-panel/panel-action-button.c
@@ -669,28 +669,18 @@ panel_action_button_load (PanelActionButtonType  type,
 			  gboolean               locked,
 			  int                    position,
 			  gboolean               exactpos,
-			  const char            *id,
-			  gboolean               compatibility)
+			  const char            *id)
 {
 	PanelActionButton *button;
-	PanelObjectType    object_type;
 
 	g_return_if_fail (panel != NULL);
 
 	button = g_object_new (PANEL_TYPE_ACTION_BUTTON, "action-type", type, NULL);
 
-	object_type = PANEL_OBJECT_ACTION;
-	if (compatibility) { /* Backward compatibility with GNOME 2.0.x */
-		if (type == PANEL_ACTION_LOCK)
-			object_type = PANEL_OBJECT_LOCK;
-		else if (type == PANEL_ACTION_LOGOUT)
-			object_type = PANEL_OBJECT_LOGOUT;
-	}
-
 	button->priv->info = panel_applet_register (GTK_WIDGET (button),
 						    NULL, NULL,
 						    panel, locked, position,
-						    exactpos, object_type, id);
+						    exactpos, PANEL_OBJECT_ACTION, id);
 	if (!button->priv->info) {
 		gtk_widget_destroy (GTK_WIDGET (button));
 		return;
@@ -732,28 +722,6 @@ panel_action_button_create (PanelToplevel         *toplevel,
 	g_free (id);
 }
 
-/* This is only for backwards compatibility with 2.0.x
- * We load an old-style lock/logout button as an action
- * button but make sure to retain the lock/logout configuration
- * so logging back into 2.0.x still works.
- */
-void
-panel_action_button_load_compatible (PanelObjectType  object_type,
-				     PanelWidget     *panel,
-				     gboolean         locked,
-				     int              position,
-				     gboolean         exactpos,
-				     const char      *id)
-{
-	PanelActionButtonType action_type;
-
-	g_assert (object_type == PANEL_OBJECT_LOGOUT || object_type == PANEL_OBJECT_LOCK);
-
-	action_type = object_type == PANEL_OBJECT_LOGOUT ? PANEL_ACTION_LOGOUT : PANEL_ACTION_LOCK;
-
-	panel_action_button_load (action_type, panel, locked, position, exactpos, id, TRUE);
-}
-
 void
 panel_action_button_load_from_gconf (PanelWidget *panel,
 				     gboolean     locked,
@@ -777,7 +745,7 @@ panel_action_button_load_from_gconf (PanelWidget *panel,
 	g_free (action_type);
 
 	panel_action_button_load (type, panel, locked,
-				  position, exactpos, id, FALSE);
+				  position, exactpos, id);
 }
 
 void
diff --git a/gnome-panel/panel-action-button.h b/gnome-panel/panel-action-button.h
index 715d1c9..f4a3d6a 100644
--- a/gnome-panel/panel-action-button.h
+++ b/gnome-panel/panel-action-button.h
@@ -69,13 +69,6 @@ void       panel_action_button_load_from_gconf  (PanelWidget            *panel,
 						 gboolean                exactpos,
 						 const char             *id);
 
-void       panel_action_button_load_compatible  (PanelObjectType         object_type,
-						 PanelWidget            *panel,
-						 gboolean                locked,
-						 int                     position,
-						 gboolean                exactpos,
-						 const char             *id);
-
 void       panel_action_button_invoke_menu      (PanelActionButton      *button,
 						 const char             *callback_name);
 
diff --git a/gnome-panel/panel-enums.h b/gnome-panel/panel-enums.h
index 9d36572..811ae05 100644
--- a/gnome-panel/panel-enums.h
+++ b/gnome-panel/panel-enums.h
@@ -80,10 +80,7 @@ typedef enum {
 	PANEL_OBJECT_APPLET,
 	PANEL_OBJECT_ACTION,
 	PANEL_OBJECT_MENU_BAR,
-	PANEL_OBJECT_SEPARATOR,
-	/* The following two are for backwards compatibility with 2.0.x */
-	PANEL_OBJECT_LOGOUT,
-	PANEL_OBJECT_LOCK
+	PANEL_OBJECT_SEPARATOR
 } PanelObjectType;
 
 typedef enum {
diff --git a/gnome-panel/panel-profile.c b/gnome-panel/panel-profile.c
index d48dd1c..b699c43 100644
--- a/gnome-panel/panel-profile.c
+++ b/gnome-panel/panel-profile.c
@@ -103,9 +103,6 @@ static GConfEnumStringPair panel_object_type_map [] = {
 	{ PANEL_OBJECT_SEPARATOR, "separator" },
 	/* The following is for backwards compatibility with 2.30.x and earlier */
 	{ PANEL_OBJECT_APPLET,    "bonobo-applet" },
-	/* The following two are for backwards compatibility with 2.0.x */
-	{ PANEL_OBJECT_LOCK,      "lock-object" },
-	{ PANEL_OBJECT_LOGOUT,    "logout-object" },
 	{ 0,                      NULL }
 };
 



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