Mercurial > pidgin.yaz
diff libgaim/buddyicon.c @ 15071:97ae8709d6dc
[gaim-migrate @ 17854]
Added ability to keep track of non-cached buddy icons
committer: Tailor Script <tailor@pidgin.im>
author | Mark Huetsch <markhuetsch> |
---|---|
date | Thu, 30 Nov 2006 10:19:09 +0000 |
parents | 577ddea3ab82 |
children | 58a23f416729 |
line wrap: on
line diff
--- a/libgaim/buddyicon.c Thu Nov 30 05:56:29 2006 +0000 +++ b/libgaim/buddyicon.c Thu Nov 30 10:19:09 2006 +0000 @@ -77,6 +77,7 @@ gaim_buddy_icon_ref(icon); gaim_buddy_icon_set_data(icon, icon_data, icon_len); + gaim_buddy_icon_set_path(icon, NULL); /* gaim_buddy_icon_set_data() makes blist.c or * conversation.c, or both, take a reference. @@ -134,6 +135,7 @@ g_free(icon->username); g_free(icon->data); + g_free(icon->path); GAIM_DBUS_UNREGISTER_POINTER(icon); g_free(icon); } @@ -339,6 +341,15 @@ gaim_buddy_icon_update(icon); } +void +gaim_buddy_icon_set_path(GaimBuddyIcon *icon, const gchar *path) +{ + g_return_if_fail(icon != NULL); + + g_free(icon->path); + icon->path = (path != NULL ? g_strdup(path) : NULL); +} + GaimAccount * gaim_buddy_icon_get_account(const GaimBuddyIcon *icon) { @@ -367,6 +378,14 @@ } const char * +gaim_buddy_icon_get_path(GaimBuddyIcon *icon) +{ + g_return_val_if_fail(icon != NULL, NULL); + + return icon->path; +} + +const char * gaim_buddy_icon_get_type(const GaimBuddyIcon *icon) { const void *data; @@ -394,7 +413,7 @@ void gaim_buddy_icons_set_for_user(GaimAccount *account, const char *username, - void *icon_data, size_t icon_len) + void *icon_data, size_t icon_len) { g_return_if_fail(account != NULL); g_return_if_fail(username != NULL);