diff options
author | Ankit Vani <a@nevitus.org> | 2013-07-15 19:41:51 +0530 |
---|---|---|
committer | Ankit Vani <a@nevitus.org> | 2013-07-15 19:41:51 +0530 |
commit | 49c8c914429f16fb841c767cb7a9dc7b12e165cc (patch) | |
tree | dab4974190e9510677a52ff93158c9d6b204f793 | |
parent | 287e0ae72533e834a119c33fb61225e451fccd7d (diff) | |
download | pidgin-49c8c914429f16fb841c767cb7a9dc7b12e165cc.tar.gz |
Added note to make buddy icon a GObject. Made GBoxed copy return a copy instead of creating a new buddy icon.
-rw-r--r-- | libpurple/buddyicon.c | 9 | ||||
-rw-r--r-- | libpurple/buddyicon.h | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/libpurple/buddyicon.c b/libpurple/buddyicon.c index ed81f4bc96..0550fceeb9 100644 --- a/libpurple/buddyicon.c +++ b/libpurple/buddyicon.c @@ -1135,9 +1135,10 @@ void purple_buddy_icon_get_scale_size(PurpleBuddyIconSpec *spec, int *width, int static PurpleBuddyIcon * purple_buddy_icon_copy(PurpleBuddyIcon *icon) { - return purple_buddy_icon_new(icon->account, icon->username, - (void *)purple_imgstore_get_data(icon->img), - purple_imgstore_get_size(icon->img), icon->checksum); + PurpleBuddyIcon *icon_copy = g_new(PurpleBuddyIcon, 1); + *icon_copy = *icon; + + return icon_copy; } GType @@ -1148,7 +1149,7 @@ purple_buddy_icon_get_type(void) if (type == 0) { type = g_boxed_type_register_static("PurpleBuddyIcon", (GBoxedCopyFunc)purple_buddy_icon_copy, - (GBoxedFreeFunc)purple_buddy_icon_unref); + (GBoxedFreeFunc)g_free); } return type; diff --git a/libpurple/buddyicon.h b/libpurple/buddyicon.h index 304662c678..07c2537e00 100644 --- a/libpurple/buddyicon.h +++ b/libpurple/buddyicon.h @@ -50,6 +50,8 @@ G_BEGIN_DECLS /** * Returns the GType for the PurpleBuddyIcon boxed structure. + * TODO Boxing of PurpleBuddyIcon is a temporary solution to having a GType for + * icons. This should rather be a GObject instead of a GBoxed. */ GType purple_buddy_icon_get_type(void); @@ -73,6 +75,7 @@ PurpleBuddyIcon *purple_buddy_icon_new(PurpleAccount *account, const char *usern /** * Increments the reference count on a buddy icon. + * TODO This can be removed when PurpleBuddyIcon is a GObject. * * @param icon The buddy icon. * @@ -82,6 +85,7 @@ PurpleBuddyIcon *purple_buddy_icon_ref(PurpleBuddyIcon *icon); /** * Decrements the reference count on a buddy icon. + * TODO This can be removed when PurpleBuddyIcon is a GObject. * * If the reference count reaches 0, the icon will be destroyed. * |