comparison 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
comparison
equal deleted inserted replaced
4792:9212d1c5b7dc 4793:677d3cb193a1
314 314
315 315
316 icon = gaim_pixbuf(NULL, "gaim.png"); 316 icon = gaim_pixbuf(NULL, "gaim.png");
317 if (icon) { 317 if (icon) {
318 gtk_window_set_icon(GTK_WINDOW(mainwindow), icon); 318 gtk_window_set_icon(GTK_WINDOW(mainwindow), icon);
319 gdk_pixbuf_unref(icon); 319 g_object_unref(G_OBJECT(icon));
320 } 320 }
321 321
322 vbox = gtk_vbox_new(FALSE, 0); 322 vbox = gtk_vbox_new(FALSE, 0);
323 gtk_container_add(GTK_CONTAINER(mainwindow), vbox); 323 gtk_container_add(GTK_CONTAINER(mainwindow), vbox);
324 324
468 guchar type; 468 guchar type;
469 guchar subtype; 469 guchar subtype;
470 guint32 len; 470 guint32 len;
471 guchar *data; 471 guchar *data;
472 guint32 x; 472 guint32 x;
473 GError *error;
473 474
474 debug_printf("Core says: "); 475 debug_printf("Core says: ");
475 g_io_channel_read(source, &type, sizeof(type), &x); 476 g_io_channel_read_chars(source, &type, sizeof(type), &x, &error);
477 if(error)
478 g_free(error);
476 if (x == 0) { 479 if (x == 0) {
477 debug_printf("CORE IS GONE!\n"); 480 debug_printf("CORE IS GONE!\n");
478 g_io_channel_close(source); 481 g_io_channel_shutdown(source, TRUE, &error);
482 if(error)
483 g_free(error);
479 return FALSE; 484 return FALSE;
480 } 485 }
481 debug_printf("%d ", type); 486 debug_printf("%d ", type);
482 g_io_channel_read(source, &subtype, sizeof(subtype), &x); 487 g_io_channel_read_chars(source, &subtype, sizeof(subtype), &x, &error);
488 if(error)
489 g_free(error);
483 if (x == 0) { 490 if (x == 0) {
484 debug_printf("CORE IS GONE!\n"); 491 debug_printf("CORE IS GONE!\n");
485 g_io_channel_close(source); 492 g_io_channel_shutdown(source, TRUE, &error);
493 if(error)
494 g_free(error);
486 return FALSE; 495 return FALSE;
487 } 496 }
488 debug_printf("%d ", subtype); 497 debug_printf("%d ", subtype);
489 g_io_channel_read(source, (guchar *)&len, sizeof(len), &x); 498 g_io_channel_read_chars(source, (guchar *)&len, sizeof(len), &x, &error);
499 if(error)
500 g_free(error);
490 if (x == 0) { 501 if (x == 0) {
491 debug_printf("CORE IS GONE!\n"); 502 debug_printf("CORE IS GONE!\n");
492 g_io_channel_close(source); 503 g_io_channel_shutdown(source, TRUE, &error);
504 if(error)
505 g_free(error);
493 return FALSE; 506 return FALSE;
494 } 507 }
495 debug_printf("(%d bytes)\n", len); 508 debug_printf("(%d bytes)\n", len);
496 509
497 data = g_malloc(len); 510 data = g_malloc(len);
498 g_io_channel_read(source, data, len, &x); 511 g_io_channel_read_chars(source, data, len, &x, &error);
512 if(error)
513 g_free(error);
499 if (x != len) { 514 if (x != len) {
500 debug_printf("CORE IS GONE! (read %d/%d bytes)\n", x, len); 515 debug_printf("CORE IS GONE! (read %d/%d bytes)\n", x, len);
501 g_free(data); 516 g_free(data);
502 g_io_channel_close(source); 517 g_io_channel_shutdown(source, TRUE, &error);
518 if(error)
519 g_free(error);
503 return FALSE; 520 return FALSE;
504 } 521 }
505 522
506 g_free(data); 523 g_free(data);
507 return TRUE; 524 return TRUE;