Mercurial > pidgin.yaz
comparison src/gtkaccount.c @ 10589:0f7452b1f777
[gaim-migrate @ 11994]
Use GLib 2.6's gstdio functions. This should fix gaim not liking non-ascii filenames in win32.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Fri, 11 Feb 2005 05:10:40 +0000 |
parents | f175ff63d571 |
children | 56d4460bb6bd |
comparison
equal
deleted
inserted
replaced
10588:529111933c9c | 10589:0f7452b1f777 |
---|---|
302 #else /* FILECHOOSER */ | 302 #else /* FILECHOOSER */ |
303 filename = g_strdup(gtk_file_selection_get_filename( | 303 filename = g_strdup(gtk_file_selection_get_filename( |
304 GTK_FILE_SELECTION(dialog->icon_filesel))); | 304 GTK_FILE_SELECTION(dialog->icon_filesel))); |
305 #endif /* FILECHOOSER */ | 305 #endif /* FILECHOOSER */ |
306 | 306 |
307 if (!filename || stat(filename, &st)) | 307 if (!filename || g_stat(filename, &st)) |
308 { | 308 { |
309 g_free(filename); | 309 g_free(filename); |
310 return; | 310 return; |
311 } | 311 } |
312 | 312 |
518 | 518 |
519 #if GTK_CHECK_VERSION(2,4,0) | 519 #if GTK_CHECK_VERSION(2,4,0) |
520 format = gdk_pixbuf_get_file_info (path, &width, &height); | 520 format = gdk_pixbuf_get_file_info (path, &width, &height); |
521 #else | 521 #else |
522 loader = gdk_pixbuf_loader_new(); | 522 loader = gdk_pixbuf_loader_new(); |
523 if (!stat(path, &st) && (file = fopen(path, "rb")) != NULL) { | 523 if (!g_stat(path, &st) && (file = g_fopen(path, "rb")) != NULL) { |
524 data = g_malloc(st.st_size); | 524 data = g_malloc(st.st_size); |
525 fread(data, 1, st.st_size, file); | 525 fread(data, 1, st.st_size, file); |
526 fclose(file); | 526 fclose(file); |
527 gdk_pixbuf_loader_write(loader, data, st.st_size, NULL); | 527 gdk_pixbuf_loader_write(loader, data, st.st_size, NULL); |
528 g_free(data); | 528 g_free(data); |
597 } | 597 } |
598 | 598 |
599 if (!g_file_test(dirname, G_FILE_TEST_IS_DIR)) { | 599 if (!g_file_test(dirname, G_FILE_TEST_IS_DIR)) { |
600 gaim_debug_info("buddyicon", "Creating icon cache directory.\n"); | 600 gaim_debug_info("buddyicon", "Creating icon cache directory.\n"); |
601 | 601 |
602 if (mkdir(dirname, S_IRUSR | S_IWUSR | S_IXUSR) < 0) { | 602 if (g_mkdir(dirname, S_IRUSR | S_IWUSR | S_IXUSR) < 0) { |
603 gaim_debug_error("buddyicon", | 603 gaim_debug_error("buddyicon", |
604 "Unable to create directory %s: %s\n", | 604 "Unable to create directory %s: %s\n", |
605 dirname, strerror(errno)); | 605 dirname, strerror(errno)); |
606 g_strfreev(prpl_formats); | 606 g_strfreev(prpl_formats); |
607 return NULL; | 607 return NULL; |