/pidgin/main: 5ae01cf621f3: Request API: fix help callback data ...

Tomasz Wasilczyk twasilczyk at pidgin.im
Fri Sep 13 07:40:30 EDT 2013


Changeset: 5ae01cf621f3b52bb6fe119b4ff137c44157fa66
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2013-09-13 13:40 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/5ae01cf621f3

Description:

Request API: fix help callback data passing

diffstat:

 pidgin/gtkrequest.c |  21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diffs (38 lines):

diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -437,6 +437,19 @@ pidgin_request_dialog_icon(PurpleRequest
 }
 
 static void
+pidgin_request_help_clicked(GtkButton *button, gpointer _unused)
+{
+	PurpleRequestHelpCb cb;
+	gpointer data;
+
+	cb = g_object_get_data(G_OBJECT(button), "pidgin-help-cb");
+	data = g_object_get_data(G_OBJECT(button), "pidgin-help-data");
+
+	g_return_if_fail(cb != NULL);
+	cb(data);
+}
+
+static void
 pidgin_request_add_help(GtkDialog *dialog, PurpleRequestCommonParameters *cpar)
 {
 	GtkWidget *button;
@@ -449,8 +462,12 @@ pidgin_request_add_help(GtkDialog *dialo
 
 	button = gtk_dialog_add_button(dialog, GTK_STOCK_HELP,
 		GTK_RESPONSE_HELP);
-	g_signal_connect(G_OBJECT(button), "clicked", (GCallback)help_cb,
-		help_data);
+
+	g_object_set_data(G_OBJECT(button), "pidgin-help-cb", help_cb);
+	g_object_set_data(G_OBJECT(button), "pidgin-help-data", help_data);
+
+	g_signal_connect(G_OBJECT(button), "clicked",
+		G_CALLBACK(pidgin_request_help_clicked), NULL);
 }
 
 static void *



More information about the Commits mailing list