Mercurial > pidgin.yaz
comparison src/gtkblist.c @ 13612:dd03aa8a28ad
[gaim-migrate @ 15998]
Use g_utf8_normalize() directly instead of calling gaim_normalize(). This makes it more clear what's happening, and also avoids a copy to a buffer.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Mon, 10 Apr 2006 20:51:51 +0000 |
parents | bbbde2f5c03b |
children | 3275a0f675e2 |
comparison
equal
deleted
inserted
replaced
13611:7f91efd5af77 | 13612:dd03aa8a28ad |
---|---|
3391 */ | 3391 */ |
3392 static gboolean | 3392 static gboolean |
3393 _search_func(GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer search_data) | 3393 _search_func(GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer search_data) |
3394 { | 3394 { |
3395 gchar *enteredstring; | 3395 gchar *enteredstring; |
3396 gchar *tmp; | |
3396 gchar *withmarkup; | 3397 gchar *withmarkup; |
3397 gchar *nomarkup; | 3398 gchar *nomarkup; |
3398 gchar *normalized; | 3399 gchar *normalized; |
3399 gboolean result; | 3400 gboolean result; |
3400 size_t i; | 3401 size_t i; |
3402 PangoLogAttr *log_attrs; | 3403 PangoLogAttr *log_attrs; |
3403 gchar *word; | 3404 gchar *word; |
3404 | 3405 |
3405 gtk_tree_model_get(model, iter, column, &withmarkup, -1); | 3406 gtk_tree_model_get(model, iter, column, &withmarkup, -1); |
3406 | 3407 |
3407 enteredstring = g_utf8_casefold(gaim_normalize(NULL, key), -1); | 3408 tmp = g_utf8_normalize(key, -1, G_NORMALIZE_DEFAULT); |
3409 enteredstring = g_utf8_casefold(tmp, -1); | |
3410 g_free(tmp); | |
3411 | |
3408 nomarkup = gaim_markup_strip_html(withmarkup); | 3412 nomarkup = gaim_markup_strip_html(withmarkup); |
3409 normalized = g_utf8_casefold(gaim_normalize(NULL, nomarkup), -1); | 3413 tmp = g_utf8_normalize(nomarkup, -1, G_NORMALIZE_DEFAULT); |
3414 g_free(nomarkup); | |
3415 normalized = g_utf8_casefold(tmp, -1); | |
3416 g_free(tmp); | |
3410 | 3417 |
3411 if (gaim_str_has_prefix(normalized, enteredstring)) | 3418 if (gaim_str_has_prefix(normalized, enteredstring)) |
3412 { | 3419 { |
3413 g_free(withmarkup); | 3420 g_free(withmarkup); |
3414 g_free(enteredstring); | 3421 g_free(enteredstring); |
3415 g_free(nomarkup); | |
3416 g_free(normalized); | 3422 g_free(normalized); |
3417 return FALSE; | 3423 return FALSE; |
3418 } | 3424 } |
3419 | 3425 |
3420 | 3426 |
3459 } | 3465 } |
3460 #endif | 3466 #endif |
3461 | 3467 |
3462 g_free(withmarkup); | 3468 g_free(withmarkup); |
3463 g_free(enteredstring); | 3469 g_free(enteredstring); |
3464 g_free(nomarkup); | |
3465 g_free(normalized); | 3470 g_free(normalized); |
3466 | 3471 |
3467 return result; | 3472 return result; |
3468 } | 3473 } |
3469 | 3474 |