? .clock.c.swp
? output
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-panel/applets/clock/ChangeLog,v
retrieving revision 1.591
diff -u -r1.591 ChangeLog
--- ChangeLog	13 Jul 2005 09:24:20 -0000	1.591
+++ ChangeLog	15 Jul 2005 07:41:19 -0000
@@ -1,3 +1,11 @@
+2005-07-15  Priit Laes  <amd@store20.com>
+
+	* calendar-client.c (get_source_uri): New function.
+	* calendar-client.[ch] (appointment_copy, appointment_finalize): add
+	support for URI field.
+	* clock.c (handle_appointments_changed): Set time or description 
+	according to appointment URI.
+
 ==================== 2.11.5 ====================
 
 ==================== 2.11.4 ====================
Index: calendar-client.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/applets/clock/calendar-client.c,v
retrieving revision 1.11
diff -u -r1.11 calendar-client.c
--- calendar-client.c	7 Jun 2005 15:30:47 -0000	1.11
+++ calendar-client.c	15 Jul 2005 07:41:25 -0000
@@ -663,6 +663,34 @@
   return NULL;
 }
 
+static char *
+get_source_uri (ECal *esource)
+{
+    ESource *source;
+    gchar *string;
+    gchar **list;
+
+    g_return_val_if_fail (E_IS_CAL (esource), NULL);
+
+    source = e_cal_get_source (esource);
+
+    string = g_strdup(e_source_get_uri (source));
+
+    if (string) {
+        list = g_strsplit(string,":",2);
+        g_free(string);
+
+        if (!list[0]) {
+            return NULL;
+        } else {
+            string = g_strdup(list[0]);
+            g_strfreev(list);
+            return string;
+        }
+    }
+    return NULL;
+}
+
 static inline int
 null_safe_strcmp (const char *a,
 		  const char *b)
@@ -722,6 +750,7 @@
     }
 
   appointment_copy->uid          = g_strdup (appointment->uid);
+  appointment_copy->uri          = g_strdup (appointment->uri);
   appointment_copy->summary      = g_strdup (appointment->summary);
   appointment_copy->description  = g_strdup (appointment->description);
   appointment_copy->color_string = g_strdup (appointment->color_string);
@@ -749,6 +778,9 @@
   g_free (appointment->description);
   appointment->description = NULL;
 
+  g_free (appointment->uri);
+  appointment->uri = NULL;
+
   g_free (appointment->color_string);
   appointment->color_string = NULL;
 
@@ -763,6 +795,7 @@
                            icaltimezone         *default_zone)
 {
   appointment->uid          = get_ical_uid (ical);
+  appointment->uri          = get_source_uri (source->source);
   appointment->summary      = get_ical_summary (ical);
   appointment->description  = get_ical_description (ical);
   appointment->color_string = get_source_color (source->source);
Index: calendar-client.h
===================================================================
RCS file: /cvs/gnome/gnome-panel/applets/clock/calendar-client.h,v
retrieving revision 1.5
diff -u -r1.5 calendar-client.h
--- calendar-client.h	7 Jun 2005 15:30:47 -0000	1.5
+++ calendar-client.h	15 Jul 2005 07:41:26 -0000
@@ -73,6 +73,7 @@
 typedef struct
 {
   char   *uid;
+  char   *uri;
   char   *summary;
   char   *description;
   char   *color_string;
Index: clock.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/applets/clock/clock.c,v
retrieving revision 1.166
diff -u -r1.166 clock.c
--- clock.c	7 Jun 2005 15:30:47 -0000	1.166
+++ clock.c	15 Jul 2005 07:41:38 -0000
@@ -1064,9 +1064,18 @@
 
                 g_assert (CALENDAR_EVENT (appointment)->type == CALENDAR_EVENT_APPOINTMENT);
 
-                if (appointment->is_all_day)
+                if (appointment->is_all_day) {
+                    if (!appointment->uri) {
                         start_text = g_strdup (_("All Day"));
-                else
+                    } else {
+                        if (strcmp(appointment->uri,"weather") == 0) {
+                            start_text = g_strdup(_("Weather"));
+                        } else if (strcmp(appointment->uri, "contacts") == 0) {
+                            start_text = g_strdup(_("Birthday"));
+                        } else 
+                            start_text = g_strdup (_("All Day"));
+                    }
+                } else
                         start_text = format_time (cd->format,
                                                   appointment->start_time,
                                                   year, month, day,
