# HG changeset patch # User Sadrul Habib Chowdhury # Date 1196473152 0 # Node ID a4237a2117abedd02be85a9cd2e3b4908a0dd7fc # Parent 760a8e02414260de0014c505d75db69d8d1c4a74# Parent 65ef019c000b42f08a8df7410612b6b98ced904a merge of 'b4353646b7529c2dd814bc707b8b269efe420120' and 'cf97e20583ba14a840946c79a5d5182fb4a6648f' diff -r 65ef019c000b -r a4237a2117ab finch/libgnt/gntentry.c --- a/finch/libgnt/gntentry.c Fri Nov 30 23:25:28 2007 +0000 +++ b/finch/libgnt/gntentry.c Sat Dec 01 01:39:12 2007 +0000 @@ -140,7 +140,6 @@ static gboolean complete_suggest(GntEntry *entry, const char *text) { - gboolean changed = FALSE; int offstart = 0, offend = 0; if (entry->word) { @@ -148,27 +147,22 @@ const char *iter = text; offstart = g_utf8_pointer_to_offset(entry->start, s); while (*iter && toupper(*s) == toupper(*iter)) { - if (*s != *iter) - changed = TRUE; *s++ = *iter++; } if (*iter) { gnt_entry_key_pressed(GNT_WIDGET(entry), iter); - changed = TRUE; } offend = g_utf8_pointer_to_offset(entry->start, entry->cursor); } else { offstart = 0; gnt_entry_set_text_internal(entry, text); - changed = TRUE; offend = g_utf8_strlen(text, -1); } - if (changed) - g_signal_emit(G_OBJECT(entry), signals[SIG_COMPLETION], 0, - entry->start + offstart, entry->start + offend); + g_signal_emit(G_OBJECT(entry), signals[SIG_COMPLETION], 0, + entry->start + offstart, entry->start + offend); update_kill_ring(entry, ENTRY_JAIL, NULL, 0); - return changed; + return TRUE; } static int diff -r 65ef019c000b -r a4237a2117ab pidgin/pidginstock.c --- a/pidgin/pidginstock.c Fri Nov 30 23:25:28 2007 +0000 +++ b/pidgin/pidginstock.c Sat Dec 01 01:39:12 2007 +0000 @@ -347,7 +347,7 @@ size_t i; GtkWidget *win; GtkIconSize microscopic, extra_small, small, medium, large, huge; - + if (stock_initted) return; @@ -372,7 +372,7 @@ { /* GTK+ Stock icon */ iconset = gtk_style_lookup_icon_set(gtk_widget_get_style(win), - stock_icons[i].filename); + stock_icons[i].filename); } else { @@ -386,11 +386,11 @@ gtk_icon_source_set_direction_wildcarded(source, TRUE); gtk_icon_source_set_size_wildcarded(source, TRUE); gtk_icon_source_set_state_wildcarded(source, TRUE); - + iconset = gtk_icon_set_new(); gtk_icon_set_add_source(iconset, source); - + gtk_icon_source_free(source); g_free(filename); } @@ -401,7 +401,7 @@ } /* register custom icon sizes */ - + microscopic = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC, 11, 11); extra_small = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL, 16, 16); small = gtk_icon_size_register(PIDGIN_ICON_SIZE_TANGO_SMALL, 22, 22); @@ -414,61 +414,41 @@ GtkIconSet *iconset; iconset = gtk_icon_set_new(); - if (sized_stock_icons[i].microscopic) - add_sized_icon(iconset, microscopic, - sized_stock_icons[i].dir, sized_stock_icons[i].rtl, - "11", sized_stock_icons[i].filename); - if (sized_stock_icons[i].extra_small) - add_sized_icon(iconset, extra_small, - sized_stock_icons[i].dir, sized_stock_icons[i].rtl, - "16", sized_stock_icons[i].filename); - if (sized_stock_icons[i].small) - add_sized_icon(iconset, small, - sized_stock_icons[i].dir, sized_stock_icons[i].rtl, - "22", sized_stock_icons[i].filename); - if (sized_stock_icons[i].medium) - add_sized_icon(iconset, medium, - sized_stock_icons[i].dir, sized_stock_icons[i].rtl, - "32", sized_stock_icons[i].filename); - if (sized_stock_icons[i].large) - add_sized_icon(iconset, large, - sized_stock_icons[i].dir, sized_stock_icons[i].rtl, - "48", sized_stock_icons[i].filename); - if (sized_stock_icons[i].huge) - add_sized_icon(iconset, huge, - sized_stock_icons[i].dir, sized_stock_icons[i].rtl, - "64", sized_stock_icons[i].filename); + +#define ADD_SIZED_ICON(name, size) do { \ + if (sized_stock_icons[i].name) \ + add_sized_icon(iconset, name, \ + sized_stock_icons[i].dir, sized_stock_icons[i].rtl, \ + size, sized_stock_icons[i].filename); \ + } while (0) + ADD_SIZED_ICON(microscopic, "11"); + ADD_SIZED_ICON(extra_small, "16"); + ADD_SIZED_ICON(small, "22"); + ADD_SIZED_ICON(medium, "32"); + ADD_SIZED_ICON(large, "48"); + ADD_SIZED_ICON(huge, "64"); +#undef ADD_SIZED_ICON gtk_icon_factory_add(icon_factory, sized_stock_icons[i].name, iconset); gtk_icon_set_unref(iconset); if (sized_stock_icons[i].translucent_name) { iconset = gtk_icon_set_new(); - if (sized_stock_icons[i].microscopic) - add_translucent_sized_icon(iconset, microscopic, - sized_stock_icons[i].dir, sized_stock_icons[i].rtl, - "11", sized_stock_icons[i].filename); - if (sized_stock_icons[i].extra_small) - add_translucent_sized_icon(iconset, extra_small, - sized_stock_icons[i].dir, sized_stock_icons[i].rtl, - "16", sized_stock_icons[i].filename); - if (sized_stock_icons[i].small) - add_translucent_sized_icon(iconset, small, - sized_stock_icons[i].dir, sized_stock_icons[i].rtl, - "22", sized_stock_icons[i].filename); - if (sized_stock_icons[i].medium) - add_translucent_sized_icon(iconset, medium, - sized_stock_icons[i].dir, sized_stock_icons[i].rtl, - "32", sized_stock_icons[i].filename); - if (sized_stock_icons[i].large) - add_translucent_sized_icon(iconset, large, - sized_stock_icons[i].dir, sized_stock_icons[i].rtl, - "48", sized_stock_icons[i].filename); - if (sized_stock_icons[i].huge) - add_translucent_sized_icon(iconset, huge, - sized_stock_icons[i].dir, sized_stock_icons[i].rtl, - "64", sized_stock_icons[i].filename); - + +#define ADD_TRANS_ICON(name, size) do { \ + if (sized_stock_icons[i].name) \ + add_translucent_sized_icon(iconset, name, \ + sized_stock_icons[i].dir, sized_stock_icons[i].rtl, \ + size, sized_stock_icons[i].filename); \ + } while (0) + ADD_TRANS_ICON(microscopic, "11"); + ADD_TRANS_ICON(extra_small, "16"); + ADD_TRANS_ICON(small, "22"); + ADD_TRANS_ICON(medium, "32"); + ADD_TRANS_ICON(large, "48"); + ADD_TRANS_ICON(huge, "64"); +#undef ADD_TRANS_ICON + gtk_icon_factory_add(icon_factory, sized_stock_icons[i].translucent_name, iconset); gtk_icon_set_unref(iconset); }