Mercurial > pidgin
comparison src/list.c @ 4793:677d3cb193a1
[gaim-migrate @ 5113]
this removes all the remaining deprecated glib, gdk, gdk-pixbuf, and gtk
function calls. Hopefully I didn't break anything.
Most of this is due to the deprecation of g_strcasecmp and g_strncasecmp.
Two functions I never thought would be deprecated, but apparently they're
no good at comparing utf8 text. g_ascii_str{,n}casecmp is OK when you're
sure that it's ASCII. Otherwise, we're supposed to use g_utf8_collate(),
except that it is case sensitive. Since glib doesn't currently have a
case-insensitive one, I wrote one. If you need to compare utf8 text, you
can use gaim_utf8_strcasecmp().
I have to go do dishes now.
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sun, 16 Mar 2003 00:01:49 +0000 |
parents | 1e28e7d802a1 |
children | 46fb754a3c10 |
comparison
equal
deleted
inserted
replaced
4792:9212d1c5b7dc | 4793:677d3cb193a1 |
---|---|
375 | 375 |
376 group = gaimbuddylist->root; | 376 group = gaimbuddylist->root; |
377 while (group) { | 377 while (group) { |
378 buddy = group->child; | 378 buddy = group->child; |
379 while (buddy) { | 379 while (buddy) { |
380 if (!g_strcasecmp(normalize(((struct buddy*)buddy)->name), norm_name) && account == ((struct buddy*)buddy)->account) { | 380 if (!gaim_utf8_strcasecmp(normalize(((struct buddy*)buddy)->name), norm_name) && account == ((struct buddy*)buddy)->account) { |
381 g_free(norm_name); | 381 g_free(norm_name); |
382 return (struct buddy*)buddy; | 382 return (struct buddy*)buddy; |
383 } | 383 } |
384 buddy = buddy->next; | 384 buddy = buddy->next; |
385 } | 385 } |
682 | 682 |
683 static gchar *get_screenname_filename(const char *name) | 683 static gchar *get_screenname_filename(const char *name) |
684 { | 684 { |
685 gchar **split; | 685 gchar **split; |
686 gchar *good; | 686 gchar *good; |
687 gchar *ret; | |
687 | 688 |
688 split = g_strsplit(name, G_DIR_SEPARATOR_S, -1); | 689 split = g_strsplit(name, G_DIR_SEPARATOR_S, -1); |
689 good = g_strjoinv(NULL, split); | 690 good = g_strjoinv(NULL, split); |
690 g_strfreev(split); | 691 g_strfreev(split); |
691 | 692 |
692 g_strup(good); | 693 ret = g_utf8_strup(good, -1); |
693 | 694 |
694 return good; | 695 g_free(good); |
696 | |
697 return ret; | |
695 } | 698 } |
696 | 699 |
697 static gboolean gaim_blist_read(const char *filename); | 700 static gboolean gaim_blist_read(const char *filename); |
698 | 701 |
699 | 702 |
1230 | 1233 |
1231 gboolean gaim_privacy_permit_add(struct gaim_account *account, const char *who) { | 1234 gboolean gaim_privacy_permit_add(struct gaim_account *account, const char *who) { |
1232 GSList *d = account->permit; | 1235 GSList *d = account->permit; |
1233 char *n = g_strdup(normalize(who)); | 1236 char *n = g_strdup(normalize(who)); |
1234 while(d) { | 1237 while(d) { |
1235 if(!g_strcasecmp(n, normalize(d->data))) | 1238 if(!gaim_utf8_strcasecmp(n, normalize(d->data))) |
1236 break; | 1239 break; |
1237 d = d->next; | 1240 d = d->next; |
1238 } | 1241 } |
1239 g_free(n); | 1242 g_free(n); |
1240 if(!d) { | 1243 if(!d) { |
1247 | 1250 |
1248 gboolean gaim_privacy_permit_remove(struct gaim_account *account, const char *who) { | 1251 gboolean gaim_privacy_permit_remove(struct gaim_account *account, const char *who) { |
1249 GSList *d = account->permit; | 1252 GSList *d = account->permit; |
1250 char *n = g_strdup(normalize(who)); | 1253 char *n = g_strdup(normalize(who)); |
1251 while(d) { | 1254 while(d) { |
1252 if(!g_strcasecmp(n, normalize(d->data))) | 1255 if(!gaim_utf8_strcasecmp(n, normalize(d->data))) |
1253 break; | 1256 break; |
1254 d = d->next; | 1257 d = d->next; |
1255 } | 1258 } |
1256 g_free(n); | 1259 g_free(n); |
1257 if(d) { | 1260 if(d) { |
1264 | 1267 |
1265 gboolean gaim_privacy_deny_add(struct gaim_account *account, const char *who) { | 1268 gboolean gaim_privacy_deny_add(struct gaim_account *account, const char *who) { |
1266 GSList *d = account->deny; | 1269 GSList *d = account->deny; |
1267 char *n = g_strdup(normalize(who)); | 1270 char *n = g_strdup(normalize(who)); |
1268 while(d) { | 1271 while(d) { |
1269 if(!g_strcasecmp(n, normalize(d->data))) | 1272 if(!gaim_utf8_strcasecmp(n, normalize(d->data))) |
1270 break; | 1273 break; |
1271 d = d->next; | 1274 d = d->next; |
1272 } | 1275 } |
1273 g_free(n); | 1276 g_free(n); |
1274 if(!d) { | 1277 if(!d) { |
1281 | 1284 |
1282 gboolean gaim_privacy_deny_remove(struct gaim_account *account, const char *who) { | 1285 gboolean gaim_privacy_deny_remove(struct gaim_account *account, const char *who) { |
1283 GSList *d = account->deny; | 1286 GSList *d = account->deny; |
1284 char *n = g_strdup(normalize(who)); | 1287 char *n = g_strdup(normalize(who)); |
1285 while(d) { | 1288 while(d) { |
1286 if(!g_strcasecmp(n, normalize(d->data))) | 1289 if(!gaim_utf8_strcasecmp(n, normalize(d->data))) |
1287 break; | 1290 break; |
1288 d = d->next; | 1291 d = d->next; |
1289 } | 1292 } |
1290 g_free(n); | 1293 g_free(n); |
1291 if(d) { | 1294 if(d) { |