pidgin: 3648d46c: Avoid unnecessary strdup's.

sadrul at pidgin.im sadrul at pidgin.im
Sat May 16 16:30:31 EDT 2009


-----------------------------------------------------------------
Revision: 3648d46c3cecf7f094b1b50e63f47179375e64e1
Ancestor: 0fc44e2e9b4c3867ea189f9705f637125cb2497c
Author: sadrul at pidgin.im
Date: 2009-05-16T19:03:41
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/3648d46c3cecf7f094b1b50e63f47179375e64e1

Modified files:
        pidgin/gtkimhtml.c

ChangeLog: 

Avoid unnecessary strdup's.

-------------- next part --------------
============================================================
--- pidgin/gtkimhtml.c	7529dc464d14362dce427d2c7dfe2c0997a51800
+++ pidgin/gtkimhtml.c	4fe8b619ae0b319a43cce791fbc8c730266b88d2
@@ -3867,12 +3867,11 @@ static gboolean gtk_imhtml_image_clicked
 	if (event->type == GDK_BUTTON_RELEASE) {
 		if(event_button->button == 3) {
 			GtkWidget *img, *item, *menu;
-			gchar *text = g_strdup_printf(_("_Save Image..."));
 			menu = gtk_menu_new();
 
 			/* buttons and such */
 			img = gtk_image_new_from_stock(GTK_STOCK_SAVE, GTK_ICON_SIZE_MENU);
-			item = gtk_image_menu_item_new_with_mnemonic(text);
+			item = gtk_image_menu_item_new_with_mnemonic(_("_Save Image..."));
 			gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img);
 			g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(gtk_imhtml_image_save), image);
 			gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
@@ -3881,9 +3880,8 @@ static gboolean gtk_imhtml_image_clicked
 			/* we only add the menu if the image is of "custom smiley size"
 			  <= 96x96 pixels */
 			if (image->width <= 96 && image->height <= 96) {
-				text = g_strdup_printf(_("_Add Custom Smiley..."));
 				img = gtk_image_new_from_stock(GTK_STOCK_ADD, GTK_ICON_SIZE_MENU);
-				item = gtk_image_menu_item_new_with_mnemonic(text);
+				item = gtk_image_menu_item_new_with_mnemonic(_("_Add Custom Smiley..."));
 				gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), img);
 				g_signal_connect(G_OBJECT(item), "activate",
 								 G_CALLBACK(gtk_imhtml_custom_smiley_save), image);
@@ -3894,7 +3892,6 @@ static gboolean gtk_imhtml_image_clicked
 			gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
 							event_button->button, event_button->time);
 
-			g_free(text);
 			return TRUE;
 		}
 	}


More information about the Commits mailing list