pidgin: 1050984d: Do not add a ':' if there's already one ...

sadrul at pidgin.im sadrul at pidgin.im
Fri May 2 13:10:50 EDT 2008


-----------------------------------------------------------------
Revision: 1050984d439516a453bb1a2c715d899e40160b25
Ancestor: d1f9a16512a75998d4cc59426a3fc6cceafa60df
Author: sadrul at pidgin.im
Date: 2008-05-02T16:55:59
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/1050984d439516a453bb1a2c715d899e40160b25

Modified files:
        pidgin/gtkrequest.c

ChangeLog: 

Do not add a ':' if there's already one at the end. Thanks to wjt for
noticing.

-------------- next part --------------
============================================================
--- pidgin/gtkrequest.c	bce544647b0db2b7bc2a30962158f6a5b79593af
+++ pidgin/gtkrequest.c	1042456ad81552b5eca35413c526a8136185cb9f
@@ -1282,6 +1282,7 @@ pidgin_request_fields(const char *title,
 				size_t col_offset = col_num * 2;
 				PurpleRequestFieldType type;
 				GtkWidget *widget = NULL;
+				const char *field_label;
 
 				label = NULL;
 				field = fl->data;
@@ -1292,17 +1293,17 @@ pidgin_request_fields(const char *title,
 				}
 
 				type = purple_request_field_get_type(field);
+				field_label = purple_request_field_get_label(field);
 
-				if (type != PURPLE_REQUEST_FIELD_BOOLEAN &&
-				    purple_request_field_get_label(field))
+				if (type != PURPLE_REQUEST_FIELD_BOOLEAN && field_label)
 				{
-					char *text;
+					char *text = NULL;
 
-					text = g_strdup_printf("%s:",
-						purple_request_field_get_label(field));
+					if (field_label[strlen(field_label) - 1] != ':')
+						text = g_strdup_printf("%s:", field_label);
 
 					label = gtk_label_new(NULL);
-					gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), text);
+					gtk_label_set_markup_with_mnemonic(GTK_LABEL(label), text ? text : field_label);
 					g_free(text);
 
 					gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);


More information about the Commits mailing list