From e1c1c85819bbfb3f0fc6cfaf52e88d1dae6441ee Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Fri, 16 Jul 1999 19:15:34 +0000 Subject: Changed gnome-pim.keys to use the --file flag Changed gnome-pim.keys to use the --file flag 1999-07-14 Miguel de Icaza * calobj.c (ical_gen_uid): Returns a UID. (ical_object_new): Use a UID when creating an event. Should get syncing done easier. 1999-07-14 Nicholas J Kreucher * calobj.c (skip_numbers): Actually skip over the numbers. (ical_object_to_vobject): Test the proper variable for storing the proper information. svn path=/trunk/; revision=1027 --- calendar/pcs/calobj.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'calendar/pcs') diff --git a/calendar/pcs/calobj.c b/calendar/pcs/calobj.c index 7b85fdc54c..0ab8c1c004 100644 --- a/calendar/pcs/calobj.c +++ b/calendar/pcs/calobj.c @@ -10,10 +10,33 @@ #include #include #include +#include #include "calobj.h" #include "timeutil.h" #include "../libversit/vcc.h" +static char * +ical_gen_uid (void) +{ + static char *domain; + time_t t = time (NULL); + + if (!domain){ + char buffer [128]; + + getdomainname (buffer, sizeof (buffer)-1); + domain = g_strdup (domain); + } + + return g_strdup_printf ( + "%s-%d-%d-%d@%s", + isodate_from_time_t (t), + getpid (), + getgid (), + getppid (), + domain); +} + iCalObject * ical_object_new (void) { @@ -23,7 +46,8 @@ ical_object_new (void) ico->seq = -1; ico->dtstamp = time (NULL); - + ico->uid = ical_gen_uid (); + return ico; } @@ -165,7 +189,7 @@ skip_numbers (char **str) if (!isdigit (**str)) return; while (**str && isdigit (**str)) - ; + (*str)++; } } @@ -939,7 +963,7 @@ ical_object_to_vobject (iCalObject *ical) store_list (o, VCCategoriesProp, ical->categories); /* resources */ - if (ical->categories) + if (ical->resources) store_list (o, VCCategoriesProp, ical->resources); /* priority */ -- cgit v1.2.3