[gnome-panel/wip/3.0-freeze-break] panel: Drop unneeded arguments in panel_applet_register()



commit d6b5ea12c609b3b8c9bc1ce71d3305e964c531d7
Author: Vincent Untz <vuntz gnome org>
Date:   Fri Mar 25 15:24:26 2011 +0100

    panel: Drop unneeded arguments in panel_applet_register()
    
    Also pass a GSettings, which we'll use for the applet.

 gnome-panel/applet.c              |   39 +++++++++++++++++++++++------
 gnome-panel/applet.h              |   11 ++++---
 gnome-panel/launcher.c            |   31 +++++++++-------------
 gnome-panel/launcher.h            |   10 +++----
 gnome-panel/panel-action-button.c |   26 ++++++++-----------
 gnome-panel/panel-action-button.h |    6 +---
 gnome-panel/panel-addto.c         |    2 +-
 gnome-panel/panel-applet-frame.c  |   46 +++++++++++++++------------------
 gnome-panel/panel-applet-frame.h  |    7 ++---
 gnome-panel/panel-menu-bar.c      |   15 +++++------
 gnome-panel/panel-menu-bar.h      |    8 ++---
 gnome-panel/panel-menu-button.c   |   26 +++++++++----------
 gnome-panel/panel-menu-button.h   |    8 ++---
 gnome-panel/panel-object-loader.c |   50 ++++++++++++------------------------
 gnome-panel/panel-separator.c     |   15 +++++------
 gnome-panel/panel-separator.h     |    7 ++---
 gnome-panel/panel.c               |    4 +-
 17 files changed, 146 insertions(+), 165 deletions(-)
---
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
index db08414..b32820e 100644
--- a/gnome-panel/applet.c
+++ b/gnome-panel/applet.c
@@ -782,6 +782,10 @@ panel_applet_destroy (GtkWidget  *widget,
 	g_list_free (info->user_menu);
 	info->user_menu = NULL;
 
+	if (info->settings)
+		g_object_unref (info->settings);
+	info->settings = NULL;
+
 	g_free (info->id);
 	info->id = NULL;
 
@@ -962,15 +966,15 @@ panel_applet_get_by_type (PanelObjectType object_type, GdkScreen *screen)
 
 AppletInfo *
 panel_applet_register (GtkWidget       *applet,
-		       gpointer         data,
-		       GDestroyNotify   data_destroy,
 		       PanelWidget     *panel,
-		       gint             pos,
-		       gboolean         exactpos,
 		       PanelObjectType  type,
-		       const char      *id)
+		       const char      *id,
+		       GSettings       *settings,
+		       gpointer         data,
+		       GDestroyNotify   data_destroy)
 {
 	AppletInfo *info;
+	int         pos;
 	
 	g_return_val_if_fail (applet != NULL && panel != NULL, NULL);
 
@@ -983,6 +987,7 @@ panel_applet_register (GtkWidget       *applet,
 	info = g_new0 (AppletInfo, 1);
 	info->type         = type;
 	info->widget       = applet;
+	info->settings     = g_object_ref (settings);
 	info->menu         = NULL;
 	info->edit_menu    = NULL;
 	info->data         = data;
@@ -994,14 +999,24 @@ panel_applet_register (GtkWidget       *applet,
 
 	registered_applets = g_slist_append (registered_applets, info);
 
-	if (panel_widget_add (panel, applet, pos, exactpos) == -1 &&
-	    panel_widget_add (panel, applet, 0, TRUE) == -1) {
+	/* Find where to insert the applet */
+        pos = g_settings_get_int (info->settings, PANEL_OBJECT_POSITION_KEY);
+        if (g_settings_get_boolean (info->settings, PANEL_OBJECT_PACK_END_KEY)) {
+                if (!panel->packed)
+                        pos = panel->size - pos;
+                else
+                        pos = -1;
+        }
+
+	/* Insert it */
+	if (panel_widget_add (panel, applet, pos, TRUE) == -1 &&
+	    panel_widget_add (panel, applet, 0, FALSE) == -1) {
 		GSList *l;
 
 		for (l = panels; l; l = l->next) {
 			panel = PANEL_WIDGET (l->data);
 
-			if (panel_widget_add (panel, applet, 0, TRUE) != -1)
+			if (panel_widget_add (panel, applet, 0, FALSE) != -1)
 				break;
 		}
 
@@ -1056,6 +1071,14 @@ panel_applet_get_position (AppletInfo *applet)
 	return applet_data->pos;
 }
 
+GSettings *
+panel_applet_get_settings (AppletInfo *applet)
+{
+	g_return_val_if_fail (applet != NULL, NULL);
+
+	return applet->settings;
+}
+
 gboolean
 panel_applet_can_freely_move (AppletInfo *applet)
 {
diff --git a/gnome-panel/applet.h b/gnome-panel/applet.h
index dbccb25..bb7cd80 100644
--- a/gnome-panel/applet.h
+++ b/gnome-panel/applet.h
@@ -17,6 +17,7 @@ G_BEGIN_DECLS
 typedef struct {
 	PanelObjectType  type;
 	GtkWidget       *widget;
+	GSettings       *settings;
 
 	GtkWidget       *menu;
 	GtkWidget       *edit_menu;
@@ -45,13 +46,12 @@ typedef struct {
 } AppletUserMenu;
 
 AppletInfo *panel_applet_register    (GtkWidget       *applet,
-				      gpointer         data,
-				      GDestroyNotify   data_destroy,
 				      PanelWidget     *panel,
-				      gint             pos,
-				      gboolean         exactpos,
 				      PanelObjectType  type,
-				      const char      *id);
+				      const char      *id,
+				      GSettings       *settings,
+				      gpointer         data,
+				      GDestroyNotify   data_destroy);
 
 const char *panel_applet_get_id           (AppletInfo      *info);
 const char *panel_applet_get_id_by_widget (GtkWidget       *widget);
@@ -77,6 +77,7 @@ void        panel_applet_save_position           (AppletInfo *applet_info,
 						  gboolean    immediate);
 
 int         panel_applet_get_position    (AppletInfo *applet);
+GSettings  *panel_applet_get_settings    (AppletInfo *applet);
 
 /* True if all the keys relevant to moving are writable
    (position, toplevel_id, panel_right_stick) */
diff --git a/gnome-panel/launcher.c b/gnome-panel/launcher.c
index 961f395..5598e74 100644
--- a/gnome-panel/launcher.c
+++ b/gnome-panel/launcher.c
@@ -766,11 +766,10 @@ lancher_properties_enabled (void)
 }
 
 static Launcher *
-load_launcher_applet (const char       *location,
-		      PanelWidget      *panel,
-		      int               pos,
-		      gboolean          exactpos,
-		      const char       *id)
+load_launcher_applet (const char  *location,
+		      PanelWidget *panel,
+		      const char  *id,
+		      GSettings   *settings)
 {
 	Launcher *launcher;
 
@@ -779,10 +778,10 @@ load_launcher_applet (const char       *location,
 	if (!launcher)
 		return NULL;
 
-	launcher->info = panel_applet_register (launcher->button, launcher,
-						free_launcher,
-						panel, pos, exactpos,
-						PANEL_OBJECT_LAUNCHER, id);
+	launcher->info = panel_applet_register (launcher->button, panel,
+						PANEL_OBJECT_LAUNCHER, id,
+						settings,
+						launcher, free_launcher);
 	if (!launcher->info) {
 		free_launcher (launcher);
 		return NULL;
@@ -810,10 +809,9 @@ load_launcher_applet (const char       *location,
 }
 
 void
-launcher_load (GSettings   *settings,
-	       PanelWidget *panel_widget,
-	       int          position,
-	       const char  *id)
+launcher_load (PanelWidget *panel_widget,
+	       const char  *id,
+	       GSettings   *settings)
 {
 	GConfClient *client;
 	Launcher    *launcher;
@@ -836,9 +834,7 @@ launcher_load (GSettings   *settings,
 
 	launcher = load_launcher_applet (launcher_location,
 					 panel_widget,
-					 position,
-					 TRUE,
-					 id);
+					 id, settings);
 
 	if (launcher) {
 		key = panel_gconf_full_key (PANEL_GCONF_OBJECTS, id, "launcher_location");
@@ -875,8 +871,7 @@ launcher_new_saved (GtkWidget *dialog,
 void
 ask_about_launcher (const char  *file,
 		    PanelWidget *panel,
-		    int          pos,
-		    gboolean     exactpos)
+		    int          pos)
 {
 	GtkWidget *dialog;
 	GKeyFile  *key_file;
diff --git a/gnome-panel/launcher.h b/gnome-panel/launcher.h
index 5cbece9..e788639 100644
--- a/gnome-panel/launcher.h
+++ b/gnome-panel/launcher.h
@@ -51,17 +51,15 @@ void		launcher_launch    		(Launcher  *launcher,
 
 void		launcher_properties		(Launcher  *launcher);
 
-void            launcher_load                   (GSettings   *settings,
-						 PanelWidget *panel_widget,
-						 gint         position,
-						 const char  *id);
+void            launcher_load                   (PanelWidget *panel_widget,
+						 const char  *id,
+						 GSettings   *settings);
 
 void            panel_launcher_delete           (Launcher *launcher);
 
 void		ask_about_launcher		(const char *file,
 						 PanelWidget *panel,
-						 int pos,
-						 gboolean exactpos);
+						 int pos);
 
 Launcher *	find_launcher			(const char *path);
 
diff --git a/gnome-panel/panel-action-button.c b/gnome-panel/panel-action-button.c
index b559e30..43eefe8 100644
--- a/gnome-panel/panel-action-button.c
+++ b/gnome-panel/panel-action-button.c
@@ -680,11 +680,10 @@ panel_action_button_style_updated (PanelActionButton *button)
 }
 
 static void
-panel_action_button_load_helper (PanelActionButtonType  type,
-				 PanelWidget           *panel,
-				 int                    position,
-				 gboolean               exactpos,
-				 const char            *id)
+panel_action_button_load_helper (PanelWidget           *panel,
+				 const char            *id,
+				 GSettings             *settings,
+				 PanelActionButtonType  type)
 {
 	PanelActionButton *button;
 
@@ -692,10 +691,10 @@ panel_action_button_load_helper (PanelActionButtonType  type,
 
 	button = g_object_new (PANEL_TYPE_ACTION_BUTTON, "action-type", type, NULL);
 
-	button->priv->info = panel_applet_register (GTK_WIDGET (button),
-						    NULL, NULL,
-						    panel, position,
-						    exactpos, PANEL_OBJECT_ACTION, id);
+	button->priv->info = panel_applet_register (GTK_WIDGET (button), panel,
+						    PANEL_OBJECT_ACTION, id,
+						    settings,
+						    NULL, NULL);
 	if (!button->priv->info) {
 		gtk_widget_destroy (GTK_WIDGET (button));
 		return;
@@ -738,11 +737,9 @@ panel_action_button_create (PanelToplevel         *toplevel,
 }
 
 void
-panel_action_button_load (GSettings *settings,
-			  PanelWidget *panel,
-			  int          position,
-			  gboolean     exactpos,
+panel_action_button_load (PanelWidget *panel,
 			  const char  *id,
+			  GSettings *settings,
 			  const char  *detail_for_type)
 {
 	int type = PANEL_ACTION_NONE;
@@ -761,8 +758,7 @@ panel_action_button_load (GSettings *settings,
 		return;
 	}
 
-	panel_action_button_load_helper (type, panel,
-				  position, exactpos, id);
+	panel_action_button_load_helper (panel, id, settings, type);
 }
 
 void
diff --git a/gnome-panel/panel-action-button.h b/gnome-panel/panel-action-button.h
index 3b3dc36..982999c 100644
--- a/gnome-panel/panel-action-button.h
+++ b/gnome-panel/panel-action-button.h
@@ -63,11 +63,9 @@ void       panel_action_button_create           (PanelToplevel         *toplevel
 void       panel_action_button_set_type         (PanelActionButton     *button,
 						 PanelActionButtonType  type);
 
-void       panel_action_button_load             (GSettings              *settings,
-						 PanelWidget            *panel,
-						 int                     position,
-						 gboolean                exactpos,
+void       panel_action_button_load             (PanelWidget            *panel,
 						 const char             *id,
+						 GSettings              *settings,
 						 const char             *detail);
 
 void       panel_action_button_invoke_menu      (PanelActionButton      *button,
diff --git a/gnome-panel/panel-addto.c b/gnome-panel/panel-addto.c
index 63442bf..439574d 100644
--- a/gnome-panel/panel-addto.c
+++ b/gnome-panel/panel-addto.c
@@ -776,7 +776,7 @@ panel_addto_add_item (PanelAddtoDialog   *dialog,
 		break;
 	case PANEL_ADDTO_LAUNCHER_NEW:
 		ask_about_launcher (NULL, dialog->panel_widget,
-				    dialog->insertion_position, FALSE);
+				    dialog->insertion_position);
 		break;
 	case PANEL_ADDTO_MENU:
 		panel_menu_button_create (dialog->panel_widget->toplevel,
diff --git a/gnome-panel/panel-applet-frame.c b/gnome-panel/panel-applet-frame.c
index a8f1c49..505e539 100644
--- a/gnome-panel/panel-applet-frame.c
+++ b/gnome-panel/panel-applet-frame.c
@@ -56,15 +56,13 @@ static void panel_applet_frame_loading_failed  (const char  *iid,
 
 static void panel_applet_frame_load_helper     (const gchar *iid,
 						PanelWidget *panel,
-						int          position,
-						gboolean     exactpos,
-						const char  *id);
+						const char  *id,
+						GSettings   *settings);
 
 struct _PanelAppletFrameActivating {
 	PanelWidget *panel;
-	int          position;
-	gboolean     exactpos;
 	char        *id;
+	GSettings   *settings;
 };
 
 /* PanelAppletFrame implementation */
@@ -563,11 +561,10 @@ _panel_applet_frame_activated (PanelAppletFrame           *frame,
 	frame->priv->panel = frame_act->panel;
 	gtk_widget_show_all (GTK_WIDGET (frame));
 
-	info = panel_applet_register (GTK_WIDGET (frame), GTK_WIDGET (frame),
-				      NULL, frame->priv->panel,
-				      frame_act->position,
-				      frame_act->exactpos, PANEL_OBJECT_APPLET,
-				      frame_act->id);
+	info = panel_applet_register (GTK_WIDGET (frame), frame->priv->panel,
+				      PANEL_OBJECT_APPLET, frame_act->id,
+				      frame_act->settings,
+				      GTK_WIDGET (frame), NULL);
 	frame->priv->applet_info = info;
 
 	panel_widget_set_applet_size_constrained (frame->priv->panel,
@@ -687,22 +684,24 @@ panel_applet_frame_reload_response (GtkWidget        *dialog,
 		PanelWidget *panel;
 		char        *iid;
 		char        *id = NULL;
-		int          position = -1;
+		GSettings   *settings = NULL;
 
 		panel = frame->priv->panel;
 		iid   = g_strdup (frame->priv->iid);
 
 		if (info) {
 			id = g_strdup (info->id);
-			position  = panel_applet_get_position (info);
+			settings = panel_applet_get_settings (info);
+			g_object_ref (settings);
 			panel_applet_clean (info);
 		}
 
-		panel_applet_frame_load_helper (iid, panel,
-						position, TRUE, id);
+		panel_applet_frame_load_helper (iid, panel, id, settings);
 
 		g_free (iid);
 		g_free (id);
+		if (settings)
+			g_object_unref (settings);
 
 	} else if (info) {
 		/* if we can't write to applets list we can't really delete
@@ -815,6 +814,7 @@ enum {
 static void
 panel_applet_frame_activating_free (PanelAppletFrameActivating *frame_act)
 {
+	g_object_unref (frame_act->settings);
 	g_free (frame_act->id);
 	g_slice_free (PanelAppletFrameActivating, frame_act);
 }
@@ -938,9 +938,8 @@ panel_applet_frame_loading_failed (const char  *iid,
 static void
 panel_applet_frame_load_helper (const gchar *iid,
 				PanelWidget *panel,
-				int          position,
-				gboolean     exactpos,
-				const char  *id)
+				const char  *id,
+				GSettings   *settings)
 {
 	PanelAppletFrameActivating *frame_act;
 
@@ -961,9 +960,8 @@ panel_applet_frame_load_helper (const gchar *iid,
 
 	frame_act = g_slice_new0 (PanelAppletFrameActivating);
 	frame_act->panel    = panel;
-	frame_act->position = position;
-	frame_act->exactpos = exactpos;
 	frame_act->id       = g_strdup (id);
+	frame_act->settings = g_object_ref (settings);
 
 	if (!panel_applets_manager_load_applet (iid, frame_act)) {
 		panel_applet_frame_loading_failed (iid, panel, id);
@@ -972,10 +970,9 @@ panel_applet_frame_load_helper (const gchar *iid,
 }
 
 void
-panel_applet_frame_load (GSettings   *settings,
-			 PanelWidget *panel_widget,
-			 int          position,
-			 const char  *id)
+panel_applet_frame_load (PanelWidget *panel_widget,
+			 const char  *id,
+			 GSettings   *settings)
 {
 	gchar *applet_iid;
 
@@ -988,8 +985,7 @@ panel_applet_frame_load (GSettings   *settings,
 		return;
 	}
 
-	panel_applet_frame_load_helper (applet_iid, panel_widget,
-					position, TRUE, id);
+	panel_applet_frame_load_helper (applet_iid, panel_widget, id, settings);
 
 	g_free (applet_iid);
 }
diff --git a/gnome-panel/panel-applet-frame.h b/gnome-panel/panel-applet-frame.h
index 720d52c..33567a0 100644
--- a/gnome-panel/panel-applet-frame.h
+++ b/gnome-panel/panel-applet-frame.h
@@ -83,10 +83,9 @@ void  panel_applet_frame_create             (PanelToplevel       *toplevel,
 					     int                  position,
 					     const char          *iid);
 
-void  panel_applet_frame_load               (GSettings           *settings,
-					     PanelWidget         *panel_widget,
-					     int                  position,
-					     const char          *id);
+void  panel_applet_frame_load               (PanelWidget         *panel_widget,
+					     const char          *id,
+					     GSettings           *settings);
 
 void  panel_applet_frame_change_orientation (PanelAppletFrame    *frame,
 					     PanelOrientation     orientation);
diff --git a/gnome-panel/panel-menu-bar.c b/gnome-panel/panel-menu-bar.c
index 86d62b6..315e671 100644
--- a/gnome-panel/panel-menu-bar.c
+++ b/gnome-panel/panel-menu-bar.c
@@ -384,11 +384,9 @@ panel_menu_bar_on_draw (GtkWidget *widget,
 }
 
 void
-panel_menu_bar_load (GSettings   *settings,
-		     PanelWidget *panel,
-		     int          position,
-		     gboolean     exactpos,
-		     const char  *id)
+panel_menu_bar_load (PanelWidget *panel,
+		     const char  *id,
+		     GSettings   *settings)
 {
 	PanelMenuBar *menubar;
 
@@ -397,9 +395,10 @@ panel_menu_bar_load (GSettings   *settings,
 	menubar = g_object_new (PANEL_TYPE_MENU_BAR, NULL);
 
 	menubar->priv->info = panel_applet_register (
-					GTK_WIDGET (menubar), NULL, NULL,
-					panel, position, exactpos,
-					PANEL_OBJECT_MENU_BAR, id);
+					GTK_WIDGET (menubar), panel,
+					PANEL_OBJECT_MENU_BAR, id,
+					settings,
+					NULL, NULL);
 	if (!menubar->priv->info) {
 		gtk_widget_destroy (GTK_WIDGET (menubar));
 		return;
diff --git a/gnome-panel/panel-menu-bar.h b/gnome-panel/panel-menu-bar.h
index 3e30993..874b3fb 100644
--- a/gnome-panel/panel-menu-bar.h
+++ b/gnome-panel/panel-menu-bar.h
@@ -56,11 +56,9 @@ GType      panel_menu_bar_get_type  (void) G_GNUC_CONST;
 void       panel_menu_bar_create           (PanelToplevel *toplevel,
 					    int            position);
 
-void       panel_menu_bar_load             (GSettings    *settings,
-					    PanelWidget  *panel,
-					    int           position,
-					    gboolean      exactpos,
-					    const char   *id);
+void       panel_menu_bar_load             (PanelWidget  *panel,
+					    const char   *id,
+					    GSettings    *settings);
 
 void       panel_menu_bar_invoke_menu      (PanelMenuBar *menubar,
 					    const char   *callback_name);
diff --git a/gnome-panel/panel-menu-button.c b/gnome-panel/panel-menu-button.c
index 62d5543..b521ca9 100644
--- a/gnome-panel/panel-menu-button.c
+++ b/gnome-panel/panel-menu-button.c
@@ -627,9 +627,8 @@ panel_menu_button_load_helper (const char  *menu_path,
 			       gboolean     use_custom_icon,
 			       const char  *tooltip,
 			       PanelWidget *panel,
-			       int          position,
-			       gboolean     exactpos,
-			       const char  *id)
+			       const char  *id,
+			       GSettings   *settings)
 {
 	PanelMenuButton *button;
 	AppletInfo      *info;
@@ -645,9 +644,11 @@ panel_menu_button_load_helper (const char  *menu_path,
 			       "has-arrow", TRUE,
 			       NULL);
 
-	info = panel_applet_register (GTK_WIDGET (button), NULL, NULL,
-				      panel, position, exactpos,
-				      PANEL_OBJECT_MENU, id);
+	info = panel_applet_register (GTK_WIDGET (button),
+				      panel,
+				      PANEL_OBJECT_MENU, id,
+				      settings,
+				      NULL, NULL);
 	if (!info) {
 		gtk_widget_destroy (GTK_WIDGET (button));
 		return;
@@ -853,11 +854,9 @@ panel_menu_button_set_use_custom_icon (PanelMenuButton *button,
 }
 
 void
-panel_menu_button_load (GSettings   *settings,
-			PanelWidget *panel,
-			int          position,
-			gboolean     exactpos,
-			const char  *id)
+panel_menu_button_load (PanelWidget *panel,
+			const char  *id,
+			GSettings   *settings)
 {
 	GConfClient  *client;
 	char         *scheme;
@@ -901,9 +900,8 @@ panel_menu_button_load (GSettings   *settings,
 				       use_custom_icon,
 				       tooltip,
 				       panel,
-				       position,
-				       exactpos,
-				       id);
+				       id,
+				       settings);
 
 	g_free (menu_path);
 	g_free (custom_icon);
diff --git a/gnome-panel/panel-menu-button.h b/gnome-panel/panel-menu-button.h
index 399e5e7..684a755 100644
--- a/gnome-panel/panel-menu-button.h
+++ b/gnome-panel/panel-menu-button.h
@@ -73,11 +73,9 @@ gboolean   panel_menu_button_get_use_menu_path   (PanelMenuButton  *button);
 void       panel_menu_button_set_use_custom_icon (PanelMenuButton  *button,
 						  gboolean          use_custom_icon);
 
-void       panel_menu_button_load                (GSettings        *settings,
-						  PanelWidget      *panel,
-						  int               position,
-						  gboolean          exactpos,
-						  const char       *id);
+void       panel_menu_button_load                (PanelWidget      *panel,
+						  const char       *id,
+						  GSettings        *settings);
 
 void       panel_menu_button_invoke_menu         (PanelMenuButton  *button,
 						  const char       *callback_name);
diff --git a/gnome-panel/panel-object-loader.c b/gnome-panel/panel-object-loader.c
index 010099f..72379ee 100644
--- a/gnome-panel/panel-object-loader.c
+++ b/gnome-panel/panel-object-loader.c
@@ -173,13 +173,6 @@ panel_object_loader_idle_handler (gpointer dummy)
 
         panel_widget = panel_toplevel_get_panel_widget (toplevel);
 
-        if (object->right_stick) {
-                if (!panel_widget->packed)
-                        object->position = panel_widget->size - object->position;
-                else
-                        object->position = -1;
-        }
-
         iid = g_settings_get_string (object->settings, PANEL_OBJECT_IID_KEY);
         ret = panel_object_iid_to_type (iid, &object_type, &object_type_detail);
 
@@ -195,44 +188,35 @@ panel_object_loader_idle_handler (gpointer dummy)
 
         switch (object_type) {
         case PANEL_OBJECT_APPLET:
-                panel_applet_frame_load (object->settings,
-                                         panel_widget,
-                                         object->position,
-                                         object->id);
+                panel_applet_frame_load (panel_widget,
+                                         object->id,
+                                         object->settings);
                 break;
         case PANEL_OBJECT_MENU:
-                panel_menu_button_load (object->settings,
-                                        panel_widget,
-                                        object->position,
-                                        TRUE,
-                                        object->id);
+                panel_menu_button_load (panel_widget,
+                                        object->id,
+                                        object->settings);
                 break;
         case PANEL_OBJECT_LAUNCHER:
-                launcher_load (object->settings,
-                               panel_widget,
-                               object->position,
-                               object->id);
+                launcher_load (panel_widget,
+                               object->id,
+                               object->settings);
                 break;
         case PANEL_OBJECT_ACTION:
-                panel_action_button_load (object->settings,
-                                          panel_widget,
-                                          object->position,
-                                          TRUE,
+                panel_action_button_load (panel_widget,
                                           object->id,
+                                          object->settings,
                                           object_type_detail);
                 break;
         case PANEL_OBJECT_MENU_BAR:
-                panel_menu_bar_load (object->settings,
-                                     panel_widget,
-                                     object->position,
-                                     TRUE,
-                                     object->id);
+                panel_menu_bar_load (panel_widget,
+                                     object->id,
+                                     object->settings);
                 break;
         case PANEL_OBJECT_SEPARATOR:
-                panel_separator_load (object->settings,
-                                      panel_widget,
-                                      object->position,
-                                      object->id);
+                panel_separator_load (panel_widget,
+                                      object->id,
+                                      object->settings);
                 break;
         default:
                 g_assert_not_reached ();
diff --git a/gnome-panel/panel-separator.c b/gnome-panel/panel-separator.c
index 572933a..1e5908a 100644
--- a/gnome-panel/panel-separator.c
+++ b/gnome-panel/panel-separator.c
@@ -228,21 +228,20 @@ panel_separator_set_orientation (PanelSeparator   *separator,
 }
 
 void
-panel_separator_load (GSettings *settings,
-		      PanelWidget *panel,
-		      int          position,
-		      const char  *id)
+panel_separator_load (PanelWidget *panel,
+		      const char  *id,
+		      GSettings   *settings)
 {
 	PanelSeparator *separator;
 
 	separator = g_object_new (PANEL_TYPE_SEPARATOR, NULL);
 
 	separator->priv->info = panel_applet_register (GTK_WIDGET (separator),
-						       NULL, NULL,
-						       panel, position,
-						       TRUE,
+						       panel,
 						       PANEL_OBJECT_SEPARATOR,
-						       id);
+						       id, settings,
+						       NULL, NULL
+						       );
 
 	if (!separator->priv->info) {
 		gtk_widget_destroy (GTK_WIDGET (separator));
diff --git a/gnome-panel/panel-separator.h b/gnome-panel/panel-separator.h
index b7dbb2c..982916f 100644
--- a/gnome-panel/panel-separator.h
+++ b/gnome-panel/panel-separator.h
@@ -54,10 +54,9 @@ struct _PanelSeparatorClass {
 GType  panel_separator_get_type          (void) G_GNUC_CONST;	
 void   panel_separator_create            (PanelToplevel    *toplevel,
 					  int               position);
-void   panel_separator_load              (GSettings        *settings,
-					  PanelWidget      *panel_widget,
-					  gint              position,
-					  const char       *id);
+void   panel_separator_load              (PanelWidget      *panel_widget,
+					  const char       *id,
+					  GSettings        *settings);
 void   panel_separator_set_orientation   (PanelSeparator   *separator,
 					  PanelOrientation  orientation);
 void   panel_separator_change_background (PanelSeparator   *separator);
diff --git a/gnome-panel/panel.c b/gnome-panel/panel.c
index 07f95ee..f16efb4 100644
--- a/gnome-panel/panel.c
+++ b/gnome-panel/panel.c
@@ -769,7 +769,7 @@ drop_urilist (PanelWidget *panel,
 					/* executable and local, so add a
 					 * launcher with it */
 					ask_about_launcher (filename, panel,
-							    pos, TRUE);
+							    pos);
 				else
 					success = FALSE;
 				g_free (filename);
@@ -928,7 +928,7 @@ drop_internal_applet (PanelWidget *panel, int pos, const char *applet_type,
 
 	} else if (!strcmp(applet_type,"LAUNCHER:ASK")) {
 		if (panel_profile_id_lists_are_writable ()) {
-			ask_about_launcher (NULL, panel, pos, TRUE);
+			ask_about_launcher (NULL, panel, pos);
 			success = TRUE;
 		} else {
 			success = FALSE;



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