Mercurial > pidgin
comparison src/gtkstatusbox.c @ 14176:27ead1cf6dcb
[gaim-migrate @ 16826]
Fix asserts at startup.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Fri, 18 Aug 2006 03:49:38 +0000 |
parents | 06a2658aa96e |
children | 00f4e261e5f0 |
comparison
equal
deleted
inserted
replaced
14175:6dd5b199a400 | 14176:27ead1cf6dcb |
---|---|
1278 if ((status_box->buddy_icon_path != NULL) && | 1278 if ((status_box->buddy_icon_path != NULL) && |
1279 (*status_box->buddy_icon_path != '\0')) | 1279 (*status_box->buddy_icon_path != '\0')) |
1280 { | 1280 { |
1281 scaled = gdk_pixbuf_new_from_file_at_scale(status_box->buddy_icon_path, | 1281 scaled = gdk_pixbuf_new_from_file_at_scale(status_box->buddy_icon_path, |
1282 icon_alc.height, icon_alc.width, FALSE, NULL); | 1282 icon_alc.height, icon_alc.width, FALSE, NULL); |
1283 g_object_unref(status_box->buddy_icon_hover); | 1283 if (status_box->buddy_icon_hover) |
1284 g_object_unref(status_box->buddy_icon_hover); | |
1284 status_box->buddy_icon_hover = gdk_pixbuf_copy(scaled); | 1285 status_box->buddy_icon_hover = gdk_pixbuf_copy(scaled); |
1285 do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 30); | 1286 do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 30); |
1286 g_object_unref(status_box->buddy_icon); | 1287 if (status_box->buddy_icon) |
1288 g_object_unref(status_box->buddy_icon); | |
1287 status_box->buddy_icon = scaled; | 1289 status_box->buddy_icon = scaled; |
1288 gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon); | 1290 gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon); |
1289 } | 1291 } |
1290 status_box->icon_size = icon_alc.height; | 1292 status_box->icon_size = icon_alc.height; |
1291 } | 1293 } |
1442 | 1444 |
1443 if ((filename != NULL) && (*filename != '\0')) | 1445 if ((filename != NULL) && (*filename != '\0')) |
1444 { | 1446 { |
1445 if (box->buddy_icon != NULL) | 1447 if (box->buddy_icon != NULL) |
1446 g_object_unref(box->buddy_icon); | 1448 g_object_unref(box->buddy_icon); |
1447 scaled = gdk_pixbuf_new_from_file_at_scale(filename, | 1449 |
1448 box->icon_size, box->icon_size, FALSE, NULL); | 1450 /* This will get called before the box is shown and will not have a size */ |
1449 if (scaled != NULL) | 1451 if (box->icon_size > 0) { |
1450 { | 1452 scaled = gdk_pixbuf_new_from_file_at_scale(filename, |
1451 box->buddy_icon_hover = gdk_pixbuf_copy(scaled); | 1453 box->icon_size, box->icon_size, FALSE, NULL); |
1452 do_colorshift(box->buddy_icon_hover, box->buddy_icon_hover, 30); | 1454 if (scaled != NULL) |
1453 box->buddy_icon = scaled; | 1455 { |
1454 gtk_image_set_from_pixbuf(GTK_IMAGE(box->icon), box->buddy_icon); | 1456 box->buddy_icon_hover = gdk_pixbuf_copy(scaled); |
1457 do_colorshift(box->buddy_icon_hover, box->buddy_icon_hover, 30); | |
1458 box->buddy_icon = scaled; | |
1459 gtk_image_set_from_pixbuf(GTK_IMAGE(box->icon), box->buddy_icon); | |
1460 } | |
1455 } | 1461 } |
1456 } | 1462 } |
1457 | 1463 |
1458 if (box->account == NULL) | 1464 if (box->account == NULL) |
1459 gaim_prefs_set_string("/gaim/gtk/accounts/buddyicon", filename); | 1465 gaim_prefs_set_string("/gaim/gtk/accounts/buddyicon", filename); |