From: Rafał Długołęcki Date: Tue, 14 Jan 2014 22:12:26 +0000 (+0100) Subject: Automatically set parent family in individual, when adding child to the family. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=316265277d8e381c76496643edd3285fbfd5b244;p=familia.git Automatically set parent family in individual, when adding child to the family. --- diff --git a/src/storage/family.c b/src/storage/family.c index 99353f1..1508cd9 100644 --- a/src/storage/family.c +++ b/src/storage/family.c @@ -1,6 +1,7 @@ #include #include "family.h" +#include "individual.h" #include "../debug.h" @@ -97,6 +98,7 @@ void familia_family_add_child(struct familia_family * family, struct familia_ind family->children = tmp; family->children[family->children_no] = individual; family->children_no++; + familia_individual_set_parents(individual, family); } else { debug("There were problems with allocating memory for family children.\n"); diff --git a/src/storage/family.h b/src/storage/family.h index a8dc2fd..50fb19c 100644 --- a/src/storage/family.h +++ b/src/storage/family.h @@ -88,6 +88,8 @@ struct familia_individual * familia_family_remove_individual(struct familia_fami /** * Adds new child in the given family + * Automatically sets family as parents in individual variable. + * * @parameter family to set the individual * @parameter individual which will be added */