aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-07-13 02:56:07 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-07-13 02:56:07 +0800
commitc55a14f76a8ba5d564c8b203582e6d8480a7e4eb (patch)
tree53102e13b1686702e27a6958c25e50351595fc11
parent74042027db990bf5fc420a70076281221a30cfcf (diff)
downloadgsoc2013-evolution-c55a14f76a8ba5d564c8b203582e6d8480a7e4eb.tar
gsoc2013-evolution-c55a14f76a8ba5d564c8b203582e6d8480a7e4eb.tar.gz
gsoc2013-evolution-c55a14f76a8ba5d564c8b203582e6d8480a7e4eb.tar.bz2
gsoc2013-evolution-c55a14f76a8ba5d564c8b203582e6d8480a7e4eb.tar.lz
gsoc2013-evolution-c55a14f76a8ba5d564c8b203582e6d8480a7e4eb.tar.xz
gsoc2013-evolution-c55a14f76a8ba5d564c8b203582e6d8480a7e4eb.tar.zst
gsoc2013-evolution-c55a14f76a8ba5d564c8b203582e6d8480a7e4eb.zip
new proto
2001-07-12 JP Rosevear <jpr@ximian.com> * cal-util/cal-util.h: new proto * cal-util/cal-util.c (cal_util_new_top_level): standard place to get your top level calendar component * pcs/cal-backend-file.c (create_cal): use it * gui/itip-utils.c (itip_send_comp): ditto * gui/e-calendar-table.c (e_calendar_table_copy_clipboard): ditto svn path=/trunk/; revision=11053
-rw-r--r--calendar/ChangeLog13
-rw-r--r--calendar/cal-util/cal-util.c25
-rw-r--r--calendar/cal-util/cal-util.h3
-rw-r--r--calendar/gui/e-calendar-table.c2
-rw-r--r--calendar/gui/itip-utils.c12
-rw-r--r--calendar/pcs/cal-backend-file.c20
6 files changed, 45 insertions, 30 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 3982b43b96..f9c320743e 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,4 +1,17 @@
2001-07-12 JP Rosevear <jpr@ximian.com>
+
+ * cal-util/cal-util.h: new proto
+
+ * cal-util/cal-util.c (cal_util_new_top_level): standard place to
+ get your top level calendar component
+
+ * pcs/cal-backend-file.c (create_cal): use it
+
+ * gui/itip-utils.c (itip_send_comp): ditto
+
+ * gui/e-calendar-table.c (e_calendar_table_copy_clipboard): ditto
+
+2001-07-12 JP Rosevear <jpr@ximian.com>
* gui/e-calendar-table.c (e_calendar_table_copy_clipboard): fix
typo breaking compilation
diff --git a/calendar/cal-util/cal-util.c b/calendar/cal-util/cal-util.c
index 160d984533..bb1b8a2f51 100644
--- a/calendar/cal-util/cal-util.c
+++ b/calendar/cal-util/cal-util.c
@@ -73,3 +73,28 @@ cal_obj_uid_list_free (GList *list)
g_list_free (list);
}
+
+icalcomponent *
+cal_util_new_top_level (void)
+{
+ icalcomponent *icalcomp;
+ icalproperty *prop;
+
+ icalcomp = icalcomponent_new (ICAL_VCALENDAR_COMPONENT);
+
+ /* RFC 2445, section 4.7.1 */
+ prop = icalproperty_new_calscale ("GREGORIAN");
+ icalcomponent_add_property (icalcomp, prop);
+
+ /* RFC 2445, section 4.7.3 */
+ prop = icalproperty_new_prodid ("-//Ximian//NONSGML Evolution Calendar//EN");
+ icalcomponent_add_property (icalcomp, prop);
+
+ /* RFC 2445, section 4.7.4. This is the iCalendar spec version, *NOT*
+ * the product version! Do not change this!
+ */
+ prop = icalproperty_new_version ("2.0");
+ icalcomponent_add_property (icalcomp, prop);
+
+ return icalcomp;
+}
diff --git a/calendar/cal-util/cal-util.h b/calendar/cal-util/cal-util.h
index 6541515c22..1333bc3334 100644
--- a/calendar/cal-util/cal-util.h
+++ b/calendar/cal-util/cal-util.h
@@ -24,6 +24,7 @@
#define CAL_UTIL_H
#include <libgnome/gnome-defs.h>
+#include <ical.h>
#include <time.h>
#include <glib.h>
@@ -52,6 +53,8 @@ typedef enum {
void cal_obj_uid_list_free (GList *list);
+icalcomponent *cal_util_new_top_level (void);
+
END_GNOME_DECLS
#endif
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index ef87a9167a..e24f1d3d2b 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -788,7 +788,7 @@ e_calendar_table_copy_clipboard (ECalendarTable *cal_table)
}
/* create temporary VCALENDAR object */
- cal_table->tmp_vcal = icalcomponent_new (ICAL_VCALENDAR_COMPONENT);
+ cal_table->tmp_vcal = cal_util_new_top_level ();
etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable));
e_table_selected_row_foreach (etable, copy_row_cb, cal_table);
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index 3108264163..f755b13558 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -275,17 +275,7 @@ itip_send_comp (CalComponentItipMethod method, CalComponent *comp)
icalvalue *value;
gchar *ical_string;
- icomp = icalcomponent_new (ICAL_VCALENDAR_COMPONENT);
-
- prop = icalproperty_new (ICAL_PRODID_PROPERTY);
- value = icalvalue_new_text ("-//Ximian/Evolution//EN");
- icalproperty_set_value (prop, value);
- icalcomponent_add_property (icomp, prop);
-
- prop = icalproperty_new (ICAL_VERSION_PROPERTY);
- value = icalvalue_new_text ("2.0");
- icalproperty_set_value (prop, value);
- icalcomponent_add_property (icomp, prop);
+ icomp = cal_util_new_top_level ();
prop = icalproperty_new (ICAL_METHOD_PROPERTY);
value = icalvalue_new_method (itip_methods_enum[method]);
diff --git a/calendar/pcs/cal-backend-file.c b/calendar/pcs/cal-backend-file.c
index c906b09ffd..028949aa1a 100644
--- a/calendar/pcs/cal-backend-file.c
+++ b/calendar/pcs/cal-backend-file.c
@@ -24,6 +24,7 @@
#include <gtk/gtksignal.h>
#include "e-util/e-dbhash.h"
#include "cal-util/cal-recur.h"
+#include "cal-util/cal-util.h"
#include "cal-backend-file.h"
@@ -677,30 +678,13 @@ static CalBackendOpenStatus
create_cal (CalBackendFile *cbfile, GnomeVFSURI *uri)
{
CalBackendFilePrivate *priv;
- icalproperty *prop;
priv = cbfile->priv;
/* Create the new calendar information */
-
- priv->icalcomp = icalcomponent_new (ICAL_VCALENDAR_COMPONENT);
-
- /* RFC 2445, section 4.7.1 */
- prop = icalproperty_new_calscale ("GREGORIAN");
- icalcomponent_add_property (priv->icalcomp, prop);
-
- /* RFC 2445, section 4.7.3 */
- prop = icalproperty_new_prodid ("-//Ximian//NONSGML Evolution Calendar//EN");
- icalcomponent_add_property (priv->icalcomp, prop);
-
- /* RFC 2445, section 4.7.4. This is the iCalendar spec version, *NOT*
- * the product version! Do not change this!
- */
- prop = icalproperty_new_version ("2.0");
- icalcomponent_add_property (priv->icalcomp, prop);
+ priv->icalcomp = cal_util_new_top_level ();
/* Create our internal data */
-
priv->comp_uid_hash = g_hash_table_new (g_str_hash, g_str_equal);
gnome_vfs_uri_ref (uri);