addritem_person_get_picture() now returns something useful: a copy
authorwwp <wwp@free.fr>
Sun, 8 Apr 2018 15:03:50 +0000 (17:03 +0200)
committerwwp <wwp@free.fr>
Sun, 8 Apr 2018 17:07:18 +0000 (19:07 +0200)
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.

src/addritem.c

index f6d9d12b2239477477800c5fdb26d97fbe97f591..3a81826335928392b92f805733d489f55e81f00c 100644 (file)
@@ -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;
 }