Mercurial > pidgin.yaz
diff src/main.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 | e4dda06a3143 |
children | 4af15fbcb00a |
line wrap: on
line diff
--- a/src/main.c Sat Mar 15 22:22:39 2003 +0000 +++ b/src/main.c Sun Mar 16 00:01:49 2003 +0000 @@ -316,7 +316,7 @@ icon = gaim_pixbuf(NULL, "gaim.png"); if (icon) { gtk_window_set_icon(GTK_WINDOW(mainwindow), icon); - gdk_pixbuf_unref(icon); + g_object_unref(G_OBJECT(icon)); } vbox = gtk_vbox_new(FALSE, 0); @@ -470,36 +470,53 @@ guint32 len; guchar *data; guint32 x; + GError *error; debug_printf("Core says: "); - g_io_channel_read(source, &type, sizeof(type), &x); + g_io_channel_read_chars(source, &type, sizeof(type), &x, &error); + if(error) + g_free(error); if (x == 0) { debug_printf("CORE IS GONE!\n"); - g_io_channel_close(source); + g_io_channel_shutdown(source, TRUE, &error); + if(error) + g_free(error); return FALSE; } debug_printf("%d ", type); - g_io_channel_read(source, &subtype, sizeof(subtype), &x); + g_io_channel_read_chars(source, &subtype, sizeof(subtype), &x, &error); + if(error) + g_free(error); if (x == 0) { debug_printf("CORE IS GONE!\n"); - g_io_channel_close(source); + g_io_channel_shutdown(source, TRUE, &error); + if(error) + g_free(error); return FALSE; } debug_printf("%d ", subtype); - g_io_channel_read(source, (guchar *)&len, sizeof(len), &x); + g_io_channel_read_chars(source, (guchar *)&len, sizeof(len), &x, &error); + if(error) + g_free(error); if (x == 0) { debug_printf("CORE IS GONE!\n"); - g_io_channel_close(source); + g_io_channel_shutdown(source, TRUE, &error); + if(error) + g_free(error); return FALSE; } debug_printf("(%d bytes)\n", len); data = g_malloc(len); - g_io_channel_read(source, data, len, &x); + g_io_channel_read_chars(source, data, len, &x, &error); + if(error) + g_free(error); if (x != len) { debug_printf("CORE IS GONE! (read %d/%d bytes)\n", x, len); g_free(data); - g_io_channel_close(source); + g_io_channel_shutdown(source, TRUE, &error); + if(error) + g_free(error); return FALSE; }