/dev/tomkiewicz/new-smileys: abae078d0525: Fix some warnings

Tomasz Wasilczyk twasilczyk at pidgin.im
Wed Apr 2 11:19:35 EDT 2014


Changeset: abae078d05254d395f63a2acb1538e7f94e0ee26
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-04-02 17:19 +0200
Branch:	 default
URL: https://hg.pidgin.im/dev/tomkiewicz/new-smileys/rev/abae078d0525

Description:

Fix some warnings

diffstat:

 pidgin/gtkaccount.c |   2 +-
 pidgin/gtklog.c     |   8 ++++----
 pidgin/gtklog.h     |   2 +-
 pidgin/gtkpounce.c  |   4 ++--
 pidgin/gtkrequest.c |  14 +++++++-------
 pidgin/gtkutils.c   |  44 ++++++++++++++++++++++++--------------------
 pidgin/gtkutils.h   |   2 +-
 7 files changed, 40 insertions(+), 36 deletions(-)

diffs (240 lines):

diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c
--- a/pidgin/gtkaccount.c
+++ b/pidgin/gtkaccount.c
@@ -846,7 +846,7 @@ add_user_options(AccountPrefsDialog *dia
 	gtk_container_add(GTK_CONTAINER(button), dialog->icon_entry);
 	gtk_widget_show(dialog->icon_entry);
 	/* TODO: Uh, isn't this next line pretty useless? */
-	pidgin_set_accessible_label (dialog->icon_entry, label);
+	pidgin_set_accessible_label(dialog->icon_entry, GTK_LABEL(label));
 	purple_imgstore_unref(dialog->icon_img);
 	dialog->icon_img = NULL;
 
diff --git a/pidgin/gtklog.c b/pidgin/gtklog.c
--- a/pidgin/gtklog.c
+++ b/pidgin/gtklog.c
@@ -452,7 +452,7 @@ static void log_select_cb(GtkTreeSelecti
 			title = g_strdup_printf(_("<span size='larger' weight='bold'>Conversation with %s on %s</span>"),
 									log->name, log_get_date(log));
 
-		gtk_label_set_markup(GTK_LABEL(viewer->label), title);
+		gtk_label_set_markup(viewer->label, title);
 		g_free(title);
 	}
 
@@ -597,13 +597,13 @@ static PidginLogViewer *display_log_view
 		title_box = gtk_dialog_get_content_area(GTK_DIALOG(lv->window));
 
 	/* Label ************/
-	lv->label = gtk_label_new(NULL);
+	lv->label = GTK_LABEL(gtk_label_new(NULL));
 
 	text = g_strdup_printf("<span size='larger' weight='bold'>%s</span>", title);
 
-	gtk_label_set_markup(GTK_LABEL(lv->label), text);
+	gtk_label_set_markup(lv->label, text);
 	gtk_misc_set_alignment(GTK_MISC(lv->label), 0, 0);
-	gtk_box_pack_start(GTK_BOX(title_box), lv->label, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(title_box), GTK_WIDGET(lv->label), FALSE, FALSE, 0);
 	g_free(text);
 
 	/* Pane *************/
diff --git a/pidgin/gtklog.h b/pidgin/gtklog.h
--- a/pidgin/gtklog.h
+++ b/pidgin/gtklog.h
@@ -61,7 +61,7 @@ struct _PidginLogViewer {
 
 	PurpleLogReadFlags flags;
 	char             *search;
-	GtkWidget        *label;
+	GtkLabel         *label;
 };
 
 
diff --git a/pidgin/gtkpounce.c b/pidgin/gtkpounce.c
--- a/pidgin/gtkpounce.c
+++ b/pidgin/gtkpounce.c
@@ -580,7 +580,7 @@ pidgin_pounce_editor_show(PurpleAccount 
 
 	gtk_box_pack_start(GTK_BOX(hbox), dialog->account_menu, FALSE, FALSE, 0);
 	gtk_widget_show(dialog->account_menu);
-	pidgin_set_accessible_label (dialog->account_menu, label);
+	pidgin_set_accessible_label(dialog->account_menu, GTK_LABEL(label));
 
 	/* Buddy: */
 	hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_BOX_SPACE);
@@ -602,7 +602,7 @@ pidgin_pounce_editor_show(PurpleAccount 
 
 	g_signal_connect(G_OBJECT(dialog->buddy_entry), "changed",
 			 G_CALLBACK(buddy_changed_cb), dialog);
-	pidgin_set_accessible_label (dialog->buddy_entry, label);
+	pidgin_set_accessible_label(dialog->buddy_entry, GTK_LABEL(label));
 
 	if (cur_pounce != NULL) {
 		gtk_entry_set_text(GTK_ENTRY(dialog->buddy_entry),
diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -524,7 +524,7 @@ pidgin_request_input(const char *title, 
 	GtkWidget *dialog;
 	GtkWidget *vbox;
 	GtkWidget *hbox;
-	GtkWidget *label;
+	GtkLabel *label;
 	GtkWidget *entry;
 	GtkWidget *img;
 	char *label_text;
@@ -591,12 +591,12 @@ pidgin_request_input(const char *title, 
 	g_free(primary_esc);
 	g_free(secondary_esc);
 
-	label = gtk_label_new(NULL);
-
-	gtk_label_set_markup(GTK_LABEL(label), label_text);
-	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+	label = GTK_LABEL(gtk_label_new(NULL));
+
+	gtk_label_set_markup(label, label_text);
+	gtk_label_set_line_wrap(label, TRUE);
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
-	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(label), FALSE, FALSE, 0);
 
 	g_free(label_text);
 
@@ -658,7 +658,7 @@ pidgin_request_input(const char *title, 
 		gtk_widget_show_all(vbox);
 	}
 
-	pidgin_set_accessible_label (entry, label);
+	pidgin_set_accessible_label(entry, label);
 	data->u.input.entry = entry;
 
 	pidgin_auto_parent_window(dialog);
diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c
--- a/pidgin/gtkutils.c
+++ b/pidgin/gtkutils.c
@@ -408,7 +408,7 @@ GtkWidget *pidgin_new_item(GtkWidget *me
 	gtk_widget_add_accelerator(menuitem, "activate", accel, str[0],
 				   GDK_MOD1_MASK, GTK_ACCEL_LOCKED);
 */
-	pidgin_set_accessible_label (menuitem, label);
+	pidgin_set_accessible_label(menuitem, GTK_LABEL(label));
 	return menuitem;
 }
 
@@ -455,7 +455,7 @@ GtkWidget *
 pidgin_pixbuf_button_from_stock(const char *text, const char *icon,
 							  PidginButtonOrientation style)
 {
-	GtkWidget *button, *image, *label, *bbox, *ibox, *lbox = NULL;
+	GtkWidget *button, *image, *bbox, *ibox, *lbox = NULL;
 
 	button = gtk_button_new();
 
@@ -480,12 +480,15 @@ pidgin_pixbuf_button_from_stock(const ch
 	}
 
 	if (text) {
+		GtkLabel *label;
+
 		gtk_box_pack_start(GTK_BOX(bbox), lbox, TRUE, TRUE, 0);
-		label = gtk_label_new(NULL);
-		gtk_label_set_text_with_mnemonic(GTK_LABEL(label), text);
-		gtk_label_set_mnemonic_widget(GTK_LABEL(label), button);
-		gtk_box_pack_start(GTK_BOX(lbox), label, FALSE, TRUE, 0);
-		pidgin_set_accessible_label (button, label);
+		label = GTK_LABEL(gtk_label_new(NULL));
+		gtk_label_set_text_with_mnemonic(label, text);
+		gtk_label_set_mnemonic_widget(label, button);
+		gtk_box_pack_start(GTK_BOX(lbox), GTK_WIDGET(label),
+			FALSE, TRUE, 0);
+		pidgin_set_accessible_label(button, label);
 	}
 
 	gtk_widget_show_all(bbox);
@@ -540,31 +543,32 @@ GtkWidget *pidgin_new_item_from_stock(Gt
 GtkWidget *
 pidgin_make_frame(GtkWidget *parent, const char *title)
 {
-	GtkWidget *vbox, *vbox2, *label, *hbox;
+	GtkWidget *vbox, *vbox2, *hbox;
+	GtkLabel *label;
 	char *labeltitle;
 
 	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, PIDGIN_HIG_BOX_SPACE);
 	gtk_box_pack_start(GTK_BOX(parent), vbox, FALSE, FALSE, 0);
 	gtk_widget_show(vbox);
 
-	label = gtk_label_new(NULL);
+	label = GTK_LABEL(gtk_label_new(NULL));
 
 	labeltitle = g_strdup_printf("<span weight=\"bold\">%s</span>", title);
-	gtk_label_set_markup(GTK_LABEL(label), labeltitle);
+	gtk_label_set_markup(label, labeltitle);
 	g_free(labeltitle);
 
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
-	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
-	gtk_widget_show(label);
-	pidgin_set_accessible_label (vbox, label);
+	gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(label), FALSE, FALSE, 0);
+	gtk_widget_show(GTK_WIDGET(label));
+	pidgin_set_accessible_label(vbox, label);
 
 	hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_BOX_SPACE);
 	gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
 	gtk_widget_show(hbox);
 
-	label = gtk_label_new("    ");
-	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
-	gtk_widget_show(label);
+	label = GTK_LABEL(gtk_label_new("    "));
+	gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label), FALSE, FALSE, 0);
+	gtk_widget_show(GTK_WIDGET(label));
 
 	vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, PIDGIN_HIG_BOX_SPACE);
 	gtk_box_pack_start(GTK_BOX(hbox), vbox2, FALSE, FALSE, 0);
@@ -1196,7 +1200,7 @@ pidgin_set_accessible_label(GtkWidget *w
 }
 
 void
-pidgin_set_accessible_relations (GtkWidget *w, GtkWidget *l)
+pidgin_set_accessible_relations (GtkWidget *w, GtkLabel *l)
 {
 	AtkObject *acc, *label;
 	AtkObject *rel_obj[1];
@@ -1204,10 +1208,10 @@ pidgin_set_accessible_relations (GtkWidg
 	AtkRelation *relation;
 
 	acc = gtk_widget_get_accessible (w);
-	label = gtk_widget_get_accessible (l);
+	label = gtk_widget_get_accessible(GTK_WIDGET(l));
 
 	/* Make sure mnemonics work */
-	gtk_label_set_mnemonic_widget(GTK_LABEL(l), w);
+	gtk_label_set_mnemonic_widget(l, w);
 
 	/* Create the labeled-by relation */
 	set = atk_object_ref_relation_set (acc);
@@ -2901,7 +2905,7 @@ pidgin_add_widget_to_vbox(GtkBox *vbox, 
 	gtk_box_pack_start(GTK_BOX(hbox), widget, expand, TRUE, 0);
 	if (label) {
 		gtk_label_set_mnemonic_widget(GTK_LABEL(label), widget);
-		pidgin_set_accessible_label (widget, label);
+		pidgin_set_accessible_label(widget, GTK_LABEL(label));
 	}
 
 	if (p_label)
diff --git a/pidgin/gtkutils.h b/pidgin/gtkutils.h
--- a/pidgin/gtkutils.h
+++ b/pidgin/gtkutils.h
@@ -492,7 +492,7 @@ void pidgin_set_accessible_label(GtkWidg
  *
  * Sets the labelled-by and label-for ATK relationships.
  */
-void pidgin_set_accessible_relations(GtkWidget *w, GtkWidget *l);
+void pidgin_set_accessible_relations(GtkWidget *w, GtkLabel *l);
 
 /**
  * pidgin_menu_position_func_helper:



More information about the Commits mailing list