Mercurial > pidgin
comparison src/buddyicon.c @ 12996:fbdc9e7ef77a
[gaim-migrate @ 15349]
Bleeter updated the buddy icon logging to be more consistent and verbose
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Sun, 22 Jan 2006 22:51:38 +0000 |
parents | 595f690399e4 |
children | 52985bb3ec70 |
comparison
equal
deleted
inserted
replaced
12995:595f690399e4 | 12996:fbdc9e7ef77a |
---|---|
211 char *filename = g_build_filename(dirname, old_icon, NULL); | 211 char *filename = g_build_filename(dirname, old_icon, NULL); |
212 if (g_stat(filename, &st) == 0) | 212 if (g_stat(filename, &st) == 0) |
213 g_unlink(filename); | 213 g_unlink(filename); |
214 g_free(filename); | 214 g_free(filename); |
215 } | 215 } |
216 gaim_debug_info("buddyicon", "Uncached file %s\n", old_icon); | |
216 } | 217 } |
217 | 218 |
218 void | 219 void |
219 gaim_buddy_icon_cache(GaimBuddyIcon *icon, GaimBuddy *buddy) | 220 gaim_buddy_icon_cache(GaimBuddyIcon *icon, GaimBuddy *buddy) |
220 { | 221 { |
239 filename = g_build_filename(dirname, random, NULL); | 240 filename = g_build_filename(dirname, random, NULL); |
240 old_icon = gaim_blist_node_get_string((GaimBlistNode*)buddy, "buddy_icon"); | 241 old_icon = gaim_blist_node_get_string((GaimBlistNode*)buddy, "buddy_icon"); |
241 | 242 |
242 if (!g_file_test(dirname, G_FILE_TEST_IS_DIR)) | 243 if (!g_file_test(dirname, G_FILE_TEST_IS_DIR)) |
243 { | 244 { |
244 gaim_debug_info("buddy icons", "Creating icon cache directory.\n"); | 245 gaim_debug_info("buddyicon", "Creating icon cache directory.\n"); |
245 | 246 |
246 if (g_mkdir(dirname, S_IRUSR | S_IWUSR | S_IXUSR) < 0) | 247 if (g_mkdir(dirname, S_IRUSR | S_IWUSR | S_IXUSR) < 0) |
247 { | 248 { |
248 gaim_debug_error("buddy icons", | 249 gaim_debug_error("buddyicon", |
249 "Unable to create directory %s: %s\n", | 250 "Unable to create directory %s: %s\n", |
250 dirname, strerror(errno)); | 251 dirname, strerror(errno)); |
251 } | 252 } |
252 } | 253 } |
253 | 254 |
254 if ((file = g_fopen(filename, "wb")) != NULL) | 255 if ((file = g_fopen(filename, "wb")) != NULL) |
255 { | 256 { |
256 fwrite(data, 1, len, file); | 257 fwrite(data, 1, len, file); |
257 fclose(file); | 258 fclose(file); |
259 gaim_debug_info("buddyicon", "Wrote file %s\n", filename); | |
258 } | 260 } |
259 else | 261 else |
260 { | 262 { |
261 gaim_debug_error("buddy icons", "Unable to create file %s: %s\n", | 263 gaim_debug_error("buddyicon", "Unable to create file %s: %s\n", |
262 filename, strerror(errno)); | 264 filename, strerror(errno)); |
263 } | 265 } |
264 | 266 |
265 g_free(filename); | 267 g_free(filename); |
266 | 268 |