commit a5b4afcf66c7f86f4d3b6ce9a5a792ea124541fd
parent 2c2680cada1bd3516aed2da1edf954fdbdeee8c7
Author: wwp <wwp@free.fr>
Date: Sun, 8 Apr 2018 17:03:50 +0200
addritem_person_get_picture() now returns something useful: a copy
of the addritem's picture full path (still to be free'd by the caller),
instead of a copy of the addritem's UID string.
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/addritem.c b/src/addritem.c
@@ -270,12 +270,16 @@ void addritem_person_set_picture( ItemPerson *person, const gchar *value ) {
}
/**
- * Get picture for person object.
+ * Get picture filename for person object.
* \param person Person object.
+ * \return copy of picture file path string (to be freed by caller - and there is
+ * no guarantee that path does exist, or NULL.
*/
gchar *addritem_person_get_picture( ItemPerson *person) {
if (person->picture)
- return g_strdup(person->picture);
+ return g_strconcat( get_rc_dir(), G_DIR_SEPARATOR_S,
+ ADDRBOOK_DIR, G_DIR_SEPARATOR_S, person->picture,
+ ".png", NULL );
return NULL;
}