about-me: do not pass the "me" pointer around all the time

From: Michal Schmidt <mschmidt@redhat.com>

There's only one GnomeAboutMe instance, the global "me". It's pointless
to pass the pointer between the functions.
---

 capplets/about-me/gnome-about-me.c |   73 ++++++++++++++++++------------------
 1 files changed, 36 insertions(+), 37 deletions(-)


diff --git a/capplets/about-me/gnome-about-me.c b/capplets/about-me/gnome-about-me.c
index 755dba8..120d3c9 100644
--- a/capplets/about-me/gnome-about-me.c
+++ b/capplets/about-me/gnome-about-me.c
@@ -188,7 +188,7 @@ about_me_destroy (void)
 }
 
 static void
-about_me_update_email (GnomeAboutMe *me)
+about_me_update_email (void)
 {
 	GList *attrs = NULL;
 	gint i;
@@ -216,7 +216,7 @@ about_me_update_email (GnomeAboutMe *me)
 }
 
 static void
-about_me_commit (GnomeAboutMe *me)
+about_me_commit (void)
 {
 	EContactName *name;
 
@@ -248,7 +248,7 @@ about_me_commit (GnomeAboutMe *me)
 		g_free (fileas);
 	}
 
-	about_me_update_email (me);
+	about_me_update_email ();
 
 	if (me->create_self) {
 		e_book_add_contact (me->book, me->contact, NULL);
@@ -262,15 +262,15 @@ about_me_commit (GnomeAboutMe *me)
 }
 
 static gboolean
-about_me_commit_from_timeout (GnomeAboutMe *me)
+about_me_commit_from_timeout (void *unused)
 {
-	about_me_commit (me);
+	about_me_commit ();
 
 	return FALSE;
 }
 
 static gboolean
-about_me_focus_out (GtkWidget *widget, GdkEventFocus *event, GnomeAboutMe *unused)
+about_me_focus_out (GtkWidget *widget, GdkEventFocus *event, void *unused)
 {
 	gchar *str;
 	const gchar *wid;
@@ -329,7 +329,7 @@ about_me_focus_out (GtkWidget *widget, GdkEventFocus *event, GnomeAboutMe *unuse
 		g_source_remove (me->commit_timeout_id);
 	}
 
-	me->commit_timeout_id = g_timeout_add (600, (GSourceFunc) about_me_commit_from_timeout, me);
+	me->commit_timeout_id = g_timeout_add (600, (GSourceFunc) about_me_commit_from_timeout, NULL);
 
 	return FALSE;
 }
@@ -406,7 +406,7 @@ about_me_set_address_field (EContactAddress *addr, guint cid, gchar *str)
 }
 
 static void
-about_me_setup_email (GnomeAboutMe *me)
+about_me_setup_email (void)
 {
 	GList *attrs, *la;
 	gboolean has_home = FALSE, has_work = FALSE;
@@ -459,7 +459,7 @@ about_me_setup_email (GnomeAboutMe *me)
  **/
 
 static void
-about_me_load_string_field (GnomeAboutMe *me, const gchar *wid, guint cid, guint aid)
+about_me_load_string_field (const gchar *wid, guint cid, guint aid)
 {
 	GtkWidget   *widget;
 	GtkBuilder  *dialog;
@@ -470,7 +470,7 @@ about_me_load_string_field (GnomeAboutMe *me, const gchar *wid, guint cid, guint
 	widget = WID (wid);
 
 	if (me->create_self == TRUE) {
-		g_signal_connect (widget, "focus-out-event", G_CALLBACK (about_me_focus_out), me);
+		g_signal_connect (widget, "focus-out-event", G_CALLBACK (about_me_focus_out), NULL);
 		return;
 	}
 
@@ -495,11 +495,11 @@ about_me_load_string_field (GnomeAboutMe *me, const gchar *wid, guint cid, guint
 		gtk_text_buffer_set_text (buffer, str, -1);
 	}
 
-	g_signal_connect (widget, "focus-out-event", G_CALLBACK (about_me_focus_out), me);
+	g_signal_connect (widget, "focus-out-event", G_CALLBACK (about_me_focus_out), NULL);
 }
 
 static void
-about_me_load_photo (GnomeAboutMe *me, EContact *contact)
+about_me_load_photo (EContact *contact)
 {
 	GtkBuilder    *dialog;
 	EContactPhoto *photo;
@@ -522,7 +522,7 @@ about_me_load_photo (GnomeAboutMe *me, EContact *contact)
 }
 
 static void
-about_me_update_photo (GnomeAboutMe *me)
+about_me_update_photo (void)
 {
 	GtkBuilder    *dialog;
 	EContactPhoto *photo;
@@ -616,11 +616,11 @@ about_me_update_photo (GnomeAboutMe *me)
 		g_free (file);
 	}
 
-	about_me_commit (me);
+	about_me_commit ();
 }
 
 static void
-about_me_load_info (GnomeAboutMe *me)
+about_me_load_info (void)
 {
 	gint i;
 
@@ -637,7 +637,7 @@ about_me_load_info (GnomeAboutMe *me)
 	}
 
 	for (i = 0; ids[i].wid != NULL; i++) {
-		about_me_load_string_field (me, ids[i].wid, ids[i].cid, i);
+		about_me_load_string_field (ids[i].wid, ids[i].cid, i);
 	}
 
 	set_fingerprint_label (me->enable_fingerprint_button,
@@ -645,8 +645,7 @@ about_me_load_info (GnomeAboutMe *me)
 }
 
 static void
-about_me_update_preview (GtkFileChooser *chooser,
-			 GnomeAboutMe   *me)
+about_me_update_preview (GtkFileChooser *chooser, void *unused)
 {
 	gchar *uri;
 
@@ -700,7 +699,7 @@ about_me_update_preview (GtkFileChooser *chooser,
 }
 
 static void
-about_me_image_clicked_cb (GtkWidget *button, GnomeAboutMe *me)
+about_me_image_clicked_cb (GtkWidget *button, void *unused)
 {
 	GtkFileChooser *chooser_dialog;
 	gint response;
@@ -740,7 +739,7 @@ about_me_image_clicked_cb (GtkWidget *button, GnomeAboutMe *me)
 	gtk_widget_show (image);
 
 	g_signal_connect (chooser_dialog, "update-preview",
-			  G_CALLBACK (about_me_update_preview), me);
+			  G_CALLBACK (about_me_update_preview), NULL);
 
 	filter = gtk_file_filter_new ();
 	gtk_file_filter_set_name (filter, _("Images"));
@@ -762,23 +761,23 @@ about_me_image_clicked_cb (GtkWidget *button, GnomeAboutMe *me)
 
 		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (me->image_chooser), filename);
 		g_free (filename);
-		about_me_update_photo (me);
+		about_me_update_photo ();
 	} else if (response == GTK_RESPONSE_NO) {
 		me->have_image = FALSE;
 		me->image_changed = TRUE;
 		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (me->image_chooser), me->person);
-		about_me_update_photo (me);
+		about_me_update_photo ();
 	}
 
 	gtk_widget_destroy (GTK_WIDGET (chooser_dialog));
 }
 
 static void
-about_me_image_changed_cb (GtkWidget *widget, GnomeAboutMe *me)
+about_me_image_changed_cb (GtkWidget *widget, void *unused)
 {
 	me->have_image = TRUE;
 	me->image_changed = TRUE;
-	about_me_update_photo (me);
+	about_me_update_photo ();
 }
 
 /* About Me Dialog Callbacks */
@@ -803,14 +802,14 @@ about_me_icon_theme_changed (GtkWindow    *window,
 }
 
 static void
-about_me_button_clicked_cb (GtkDialog *dialog, gint response_id, GnomeAboutMe *me)
+about_me_button_clicked_cb (GtkDialog *dialog, gint response_id, void *unused)
 {
 	if (response_id == GTK_RESPONSE_HELP)
 		g_print ("Help goes here");
 	else {
 		if (me->commit_timeout_id) {
 			g_source_remove (me->commit_timeout_id);
-			about_me_commit (me);
+			about_me_commit ();
 		}
 
 		about_me_destroy ();
@@ -819,7 +818,7 @@ about_me_button_clicked_cb (GtkDialog *dialog, gint response_id, GnomeAboutMe *m
 }
 
 static void
-about_me_passwd_clicked_cb (GtkWidget *button, GnomeAboutMe *me)
+about_me_passwd_clicked_cb (GtkWidget *button, void *unused)
 {
 	GtkBuilder *dialog;
 
@@ -828,7 +827,7 @@ about_me_passwd_clicked_cb (GtkWidget *button, GnomeAboutMe *me)
 }
 
 static void
-about_me_fingerprint_button_clicked_cb (GtkWidget *button, GnomeAboutMe *me)
+about_me_fingerprint_button_clicked_cb (GtkWidget *button, void *unused)
 {
 	fingerprint_button_clicked (me->dialog,
 				    me->enable_fingerprint_button,
@@ -864,7 +863,7 @@ about_me_setup_dialog (void)
 	/* Connect the close button signal */
 	main_dialog = WID ("about-me-dialog");
 	g_signal_connect (main_dialog, "response",
-			  G_CALLBACK (about_me_button_clicked_cb), me);
+			  G_CALLBACK (about_me_button_clicked_cb), NULL);
 
 	gtk_window_set_resizable (GTK_WINDOW (main_dialog), FALSE);
 	capplet_set_icon (main_dialog, "user-info");
@@ -913,14 +912,14 @@ about_me_setup_dialog (void)
 			}
 		}
 	} else {
-		about_me_setup_email (me);
+		about_me_setup_email ();
 	}
 
 	me->login = g_strdup (g_get_user_name ());
 	me->username = g_strdup (g_get_real_name ());
 
 	/* Contact Tab */
-	about_me_load_photo (me, me->contact);
+	about_me_load_photo (me->contact);
 
 	widget = WID ("fullname");
 	str = g_strdup_printf ("<b><span size=\"xx-large\">%s</span></b>", me->username);
@@ -937,22 +936,22 @@ about_me_setup_dialog (void)
 
 	widget = WID ("password");
 	g_signal_connect (widget, "clicked",
-			  G_CALLBACK (about_me_passwd_clicked_cb), me);
+			  G_CALLBACK (about_me_passwd_clicked_cb), NULL);
 
 	widget = WID ("button-image");
 	g_signal_connect (widget, "clicked",
-			  G_CALLBACK (about_me_image_clicked_cb), me);
+			  G_CALLBACK (about_me_image_clicked_cb), NULL);
 
 	me->enable_fingerprint_button = WID ("enable_fingerprint_button");
 	me->disable_fingerprint_button = WID ("disable_fingerprint_button");
 
 	g_signal_connect (me->enable_fingerprint_button, "clicked",
-			  G_CALLBACK (about_me_fingerprint_button_clicked_cb), me);
+			  G_CALLBACK (about_me_fingerprint_button_clicked_cb), NULL);
 	g_signal_connect (me->disable_fingerprint_button, "clicked",
-			  G_CALLBACK (about_me_fingerprint_button_clicked_cb), me);
+			  G_CALLBACK (about_me_fingerprint_button_clicked_cb), NULL);
 
 	g_signal_connect (me->image_chooser, "changed",
-			  G_CALLBACK (about_me_image_changed_cb), me);
+			  G_CALLBACK (about_me_image_changed_cb), NULL);
 
 	/* Address tab: set up the focus chains */
 	chain = g_list_prepend (NULL, WID ("addr-country-1"));
@@ -975,7 +974,7 @@ about_me_setup_dialog (void)
 	gtk_container_set_focus_chain (GTK_CONTAINER (widget), chain);
 	g_list_free (chain);
 
-	about_me_load_info (me);
+	about_me_load_info ();
 
 	gtk_widget_show_all (main_dialog);
 
