aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-12-12 10:17:32 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-12-12 10:17:32 +0800
commit1de2b20cd497dbf35c96b162dace5a211f2bc679 (patch)
tree22d38893fef73b960854cde9f2536e13a83ca8a2
parentcb96794cec2852c404677d969543c01bff8a3635 (diff)
downloadgsoc2013-evolution-1de2b20cd497dbf35c96b162dace5a211f2bc679.tar
gsoc2013-evolution-1de2b20cd497dbf35c96b162dace5a211f2bc679.tar.gz
gsoc2013-evolution-1de2b20cd497dbf35c96b162dace5a211f2bc679.tar.bz2
gsoc2013-evolution-1de2b20cd497dbf35c96b162dace5a211f2bc679.tar.lz
gsoc2013-evolution-1de2b20cd497dbf35c96b162dace5a211f2bc679.tar.xz
gsoc2013-evolution-1de2b20cd497dbf35c96b162dace5a211f2bc679.tar.zst
gsoc2013-evolution-1de2b20cd497dbf35c96b162dace5a211f2bc679.zip
This is to make things work with libical 0.21helix1 and later. Warnings
2000-12-11 Federico Mena Quintero <federico@helixcode.com> This is to make things work with libical 0.21helix1 and later. Warnings remain because at last libical was constified; will take care of those tomorrow. * cal-util/timeutil.h: #include <ical.h> instead of <icaltypes.h> * gui/e-itip-control.c: Likewise. * gui/e-meeting-edit.c: Likewise. * gui/itip-utils.h: Likewise. * cal-util/cal-component.c (alarm_uid_from_prop): constify. (cal_component_get_status): Updated for new libical API. (cal_component_set_status): Likewise. * gui/calendar-model.c (ensure_task_complete): Removed unused status code. (ensure_task_not_complete): Update for new status API. * gui/dialogs/task-editor.c (status_string_to_value): Removed function. (status_value_to_string): Removed function. (status_string_map): Removed variable. (fill_widgets): Update for new status API. (dialog_to_comp_object): Likewise. svn path=/trunk/; revision=6932
-rw-r--r--calendar/ChangeLog85
-rw-r--r--calendar/cal-util/cal-component.c26
-rw-r--r--calendar/cal-util/cal-component.h4
-rw-r--r--calendar/cal-util/timeutil.h2
-rw-r--r--calendar/gui/calendar-model.c10
-rw-r--r--calendar/gui/dialogs/task-editor.c48
-rw-r--r--calendar/gui/e-itip-control.c1
-rw-r--r--calendar/gui/e-meeting-edit.c1
-rw-r--r--calendar/gui/itip-utils.h1
9 files changed, 81 insertions, 97 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index ab05db166c..7d66a7730d 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,32 @@
+2000-12-11 Federico Mena Quintero <federico@helixcode.com>
+
+ This is to make things work with libical 0.21helix1 and later.
+ Warnings remain because at last libical was constified; will take
+ care of those tomorrow.
+
+ * cal-util/timeutil.h: #include <ical.h> instead of <icaltypes.h>
+
+ * gui/e-itip-control.c: Likewise.
+
+ * gui/e-meeting-edit.c: Likewise.
+
+ * gui/itip-utils.h: Likewise.
+
+ * cal-util/cal-component.c (alarm_uid_from_prop): constify.
+ (cal_component_get_status): Updated for new libical API.
+ (cal_component_set_status): Likewise.
+
+ * gui/calendar-model.c (ensure_task_complete): Removed unused
+ status code.
+ (ensure_task_not_complete): Update for new status API.
+
+ * gui/dialogs/task-editor.c (status_string_to_value): Removed
+ function.
+ (status_value_to_string): Removed function.
+ (status_string_map): Removed variable.
+ (fill_widgets): Update for new status API.
+ (dialog_to_comp_object): Likewise.
+
2000-12-11 Damon Chaplin <damon@helixcode.com>
* cal-util/cal-recur.c (generate_instances_for_chunk): updated the
@@ -17,7 +46,7 @@
Fixed the 'All day event' toggle button.
Made the 'Alarm' page sensitive as appropriate when filling widgets.
(Though note that the alarm widgets are not being set yet.)
-
+
* gui/dialogs/task-editor.c: added changed flag as above.
* gui/event-editor-dialog.glade: used good names for all the
@@ -59,8 +88,8 @@
2000-12-08 JP Rosevear <jpr@helixcode.com>
- * gui/e-calendar-table.c (e_calendar_table_init): Attach signal
- handlers to the e_scrolled_table's etable rather than to the
+ * gui/e-calendar-table.c (e_calendar_table_init): Attach signal
+ handlers to the e_scrolled_table's etable rather than to the
e_scrolled_table directly
(e_calendar_table_on_double_click): This signal provides more
params now
@@ -76,7 +105,7 @@
until pcs can be altered (longer term)
* conduits/todo/todo-conduit.c (post_sync): ditto
-
+
2000-12-07 Chris Toshok <toshok@helixcode.com>
* cal-client/Makefile.am (client_test_LDADD): add
@@ -140,7 +169,7 @@
* pcs/cal-backend.h: update prototype
- * pcs/cal-backend.c (cal_backend_compute_changes_foreach_key): Build
+ * pcs/cal-backend.c (cal_backend_compute_changes_foreach_key): Build
the corba struct rather than the old calobjchange thing
(cal_backend_compute_changes): ditto. build and return the actual
corba sequence rather than the list of calobjchanges
@@ -149,17 +178,17 @@
* cal-util/cal-util.h: Remove CalObjChange cruft
* cal-util/cal-util.c (cal_obj_change_list_free): Kill
-
+
2000-12-06 JP Rosevear <jpr@helixcode.com>
- * cal-util/cal-util.c:
+ * cal-util/cal-util.c:
* conduits/calendar/calendar-conduit.c (map_name): Update so as not to conflict
with calendar
(next_changed_item): update to use CalClientChange instead of CalObjChange
(compute_status): ditto
(pre_sync): ditto
- (for_each_modified): since we now have the cal component we can call
+ (for_each_modified): since we now have the cal component we can call
local_record_from_comp directly
* conduits/todo/todo-conduit.c: same as above
@@ -203,16 +232,16 @@
CalClientChange.
* cal-client/Makefile.am: Build new files
-
+
2000-12-06 JP Rosevear <jpr@helixcode.com>
* conduits/todo/Makefile.am: Fix my build stupidty READ THE MACRO
-
+
* conduits/calendar/Makefile.am: ditto
2000-12-04 JP Rosevear <jpr@helixcode.com>
- * gui/e-day-view-time-item.c (e_day_view_time_item_get_column_width):
+ * gui/e-day-view-time-item.c (e_day_view_time_item_get_column_width):
Initialize max_large_digit_width to 0 to prevent crazy sizing issues.
2000-12-04 Dan Winship <danw@helixcode.com>
@@ -283,7 +312,7 @@
* conduits/calendar/calendar-conduit.c: Debug message cleanups
(get_ical_day): Fix off-by-one error which affected weekly occurences.
(comp_from_remote_record): Monthly by day and by date were reversed
- (nth_weekday): function taken from event-editor.c that encodes BYDAY
+ (nth_weekday): function taken from event-editor.c that encodes BYDAY
values - this needs to be in libical really.
(comp_from_remote_record): Don't set the description if the pilot note
is null. Rejig so that we don't have to free objects.
@@ -329,7 +358,7 @@
2000-11-28 Damon Chaplin <damon@helixcode.com>
- * gui/e-day-view*.[hc]:
+ * gui/e-day-view*.[hc]:
* gui/e-week-view*.[hc]: finished 12-hour support and tried to tidy
up & comment the drawing code in places. Also fixed a couple of bugs I
spotted. All the options on the 'Calendar' page should now work.
@@ -348,7 +377,7 @@
* conduits/todo/todo-conduit.c (free_prepare): Ditto
- * conduits/calendar/calendar-conduit.c (free_prepare): Adjust
+ * conduits/calendar/calendar-conduit.c (free_prepare): Adjust
free_prepare to the correct signal parameters. Don't actually
do anything - there is a semantic discrepancy that needs to be
resolved.
@@ -361,7 +390,7 @@
* gui/gnome-cal.c: added more support for config settings.
- * gui/e-week-view.[hc]:
+ * gui/e-week-view.[hc]:
* gui/e-day-view.[hc]: added support for setting - show event end
times, week start day and 12-hour format (unfinished).
@@ -382,7 +411,7 @@
* gui/dialogs/task-editor.c (task_editor_create_date_edit): use
config settings.
- * gui/dialogs/cal-prefs-dialog.c (cal_prefs_dialog_update_config):
+ * gui/dialogs/cal-prefs-dialog.c (cal_prefs_dialog_update_config):
updated EDateEdit calls.
2000-11-24 Federico Mena Quintero <federico@helixcode.com>
@@ -395,7 +424,7 @@
* cal-util/cal-component.c (free_icalcomponent): DOH, fixed
reversed test for the presence of the icalcomp's parent. This was
causing memory leaks in the Wombat and elsewhere.
-
+
* pcs/cal-backend.c (cal_backend_set_node_timet): Plug leak.
2000-11-24 Federico Mena Quintero <federico@helixcode.com>
@@ -413,8 +442,8 @@
* pcs/cal-backend.c (cal_backend_log_entry): Plug leak.
(cal_backend_log_sync): Free the entry->uid.
- * util/icalendar-save.[ch]:
- * util/icalendar-test.c:
+ * util/icalendar-save.[ch]:
+ * util/icalendar-test.c:
* util/icalendar.[ch]: Removed obsolete files.
2000-11-21 Federico Mena Quintero <federico@helixcode.com>
@@ -440,8 +469,8 @@
(time_format_changed): Removed.
(colors_changed): Removed.
- * gui/calendar-commands.h:
- * gui/prop.c (prop_apply):
+ * gui/calendar-commands.h:
+ * gui/prop.c (prop_apply):
* gui/calendar-commands.c (init_calendar): Removed the old to-do
list crap.
@@ -468,7 +497,7 @@
thing to do for most meetings.
2000-11-13 Jesse Pavel <jpavel@helixcode.com>
-
+
* gui/e-itip-control.c: made the REPLY code actually work.
2000-11-13 Jesse Pavel <jpavel@helixcode.com>
@@ -616,11 +645,11 @@
component.
2000-11-08 Jesse Pavel <jpavel@helixcode.com>
-
+
* gui/e-itip-control.c, gui/e-itip-control.glade: updated the GUI
to allow the user to add PUBLISHed events to his calendar, and created
unworking buttons for meeting requests.
-
+
2000-11-08 Federico Mena Quintero <federico@helixcode.com>
These changes fix bugzilla bugs #874 and #875.
@@ -687,7 +716,7 @@
* gui/e-itip-control.c, gui/e-itip-control.glade: changed to GUI to
accomodate dynamically generated buttons, which will be tailored to
the type of iTip message that is incoming.
-
+
* gui/e-meeting-dialog.glade gui/e-meeting-edit.c: added a new button
to publish events, in addition to requesting meetings.
@@ -758,7 +787,7 @@
* gui/main.c: (main): added call to bindtextdomain and textdomain, so
all calendar gui shows up localized.
-
+
2000-10-31 Federico Mena Quintero <federico@helixcode.com>
* gui/event-editor.c (count_by_xxx): Hmmm. SHRT_MAX changed to
@@ -778,7 +807,7 @@
add changed_hash.
* conduits/calendar/calendar-conduit.h: ditto
-
+
* conduits/todo/todo-conduit.c (next_changed_item): Utility function
to get the next "really" changed item (changed status can be cleared now)
(compute_status): Compute status based on changed_hash
@@ -858,7 +887,7 @@
2000-10-27 <jpr@helixcode.com>
- * conduits/calendar/calendar-conduit.c (check_for_slow_setting):
+ * conduits/calendar/calendar-conduit.c (check_for_slow_setting):
Check boundary case of fast sync
* conduits/todo/todo-conduit.c (check_for_slow_setting): ditto
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c
index 4aafdbf13a..cc920c19c6 100644
--- a/calendar/cal-util/cal-component.c
+++ b/calendar/cal-util/cal-component.c
@@ -607,7 +607,7 @@ scan_property (CalComponent *comp, icalproperty *prop)
static const char *
alarm_uid_from_prop (icalproperty *prop)
{
- char *xstr;
+ const char *xstr;
g_assert (icalproperty_isa (prop) == ICAL_X_PROPERTY);
@@ -1129,12 +1129,13 @@ cal_component_set_uid (CalComponent *comp, const char *uid)
/**
* cal_component_get_status:
* @comp: A calendar component object.
- * @status: Return value for the status string.
+ * @status: Return value for the status value. It is set to #ICAL_STATUS_NONE
+ * if the component has no status property.
*
* Queries the status property of a calendar component object.
**/
void
-cal_component_get_status (CalComponent *comp, const char **status)
+cal_component_get_status (CalComponent *comp, icalproperty_status *status)
{
CalComponentPrivate *priv;
@@ -1146,7 +1147,7 @@ cal_component_get_status (CalComponent *comp, const char **status)
g_return_if_fail (priv->icalcomp != NULL);
if (!priv->status) {
- *status = NULL;
+ *status = ICAL_STATUS_NONE;
return;
}
@@ -1156,25 +1157,25 @@ cal_component_get_status (CalComponent *comp, const char **status)
/**
* cal_component_set_status:
* @comp: A calendar component object.
- * @status: a status string, e.g. "IN-PROCESS", "NEEDS-ACTION". See the RFC.
+ * @status: Status value. You should use #ICAL_STATUS_NONE if you want to unset
+ * this property.
*
- * Sets the status string property of a calendar component object.
+ * Sets the status property of a calendar component object.
**/
void
-cal_component_set_status (CalComponent *comp, const char *status)
+cal_component_set_status (CalComponent *comp, icalproperty_status status)
{
CalComponentPrivate *priv;
g_return_if_fail (comp != NULL);
g_return_if_fail (IS_CAL_COMPONENT (comp));
- g_return_if_fail (status != NULL);
priv = comp->priv;
g_return_if_fail (priv->icalcomp != NULL);
priv->need_sequence_inc = TRUE;
- if (status == NULL) {
+ if (status == ICAL_STATUS_NONE) {
if (priv->status) {
icalcomponent_remove_property (priv->icalcomp, priv->status);
icalproperty_free (priv->status);
@@ -1185,11 +1186,10 @@ cal_component_set_status (CalComponent *comp, const char *status)
}
if (priv->status) {
- icalproperty_set_status (priv->status, (char *) status);
+ icalproperty_set_status (priv->status, status);
} else {
- priv->status = icalproperty_new_status ((char *) status);
- icalcomponent_add_property (priv->icalcomp,
- priv->status);
+ priv->status = icalproperty_new_status (status);
+ icalcomponent_add_property (priv->icalcomp, priv->status);
}
}
diff --git a/calendar/cal-util/cal-component.h b/calendar/cal-util/cal-component.h
index eb4b129f17..f59bb33a7b 100644
--- a/calendar/cal-util/cal-component.h
+++ b/calendar/cal-util/cal-component.h
@@ -165,8 +165,8 @@ void cal_component_commit_sequence (CalComponent *comp);
void cal_component_get_uid (CalComponent *comp, const char **uid);
void cal_component_set_uid (CalComponent *comp, const char *uid);
-void cal_component_get_status (CalComponent *comp, const char **status);
-void cal_component_set_status (CalComponent *comp, const char *status);
+void cal_component_get_status (CalComponent *comp, icalproperty_status *status);
+void cal_component_set_status (CalComponent *comp, icalproperty_status status);
void cal_component_get_categories_list (CalComponent *comp, GSList **categ_list);
void cal_component_set_categories_list (CalComponent *comp, GSList *categ_list);
diff --git a/calendar/cal-util/timeutil.h b/calendar/cal-util/timeutil.h
index b8fa6400d2..11bfcceb05 100644
--- a/calendar/cal-util/timeutil.h
+++ b/calendar/cal-util/timeutil.h
@@ -11,7 +11,7 @@
#include <time.h>
-#include <icaltypes.h>
+#include <ical.h>
time_t time_from_isodate (char *str);
diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c
index 8de4ab2e09..20c2bff234 100644
--- a/calendar/gui/calendar-model.c
+++ b/calendar/gui/calendar-model.c
@@ -1915,7 +1915,6 @@ ensure_task_complete (CalComponent *comp,
{
struct icaltimetype *old_completed = NULL;
struct icaltimetype new_completed;
- const char *old_status;
int *old_percent, new_percent;
gboolean set_completed = TRUE;
@@ -1945,9 +1944,6 @@ ensure_task_complete (CalComponent *comp,
}
if (old_percent)
cal_component_free_percent (old_percent);
-
- /* Status. */
- cal_component_get_status (comp, &old_status);
}
@@ -1958,7 +1954,7 @@ ensure_task_complete (CalComponent *comp,
static void
ensure_task_not_complete (CalComponent *comp)
{
- const char *old_status;
+ icalproperty_status old_status;
int *old_percent;
/* Date Completed. */
@@ -1973,8 +1969,8 @@ ensure_task_not_complete (CalComponent *comp)
/* Status. */
cal_component_get_status (comp, &old_status);
- if (old_status && !strcmp (old_status, "COMPLETED"))
- cal_component_set_status (comp, "NEEDS-ACTION");
+ if (old_status == ICAL_STATUS_COMPLETED)
+ cal_component_set_status (comp, ICAL_STATUS_NEEDSACTION);
}
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
index 211c31321a..6114ffa529 100644
--- a/calendar/gui/dialogs/task-editor.c
+++ b/calendar/gui/dialogs/task-editor.c
@@ -161,9 +161,6 @@ static void raise_and_focus (GtkWidget *widget);
static TaskEditorPriority priority_value_to_index (int priority_value);
static int priority_index_to_value (TaskEditorPriority priority);
-static int status_string_to_value (const char *status_string);
-static const char* status_value_to_string (int status);
-
static void completed_changed (EDateEdit *dedit,
TaskEditor *tedit);
static void status_changed (GtkMenu *menu,
@@ -744,7 +741,7 @@ fill_widgets (TaskEditor *tedit)
int *priority_value, *percent;
icalproperty_status status;
TaskEditorPriority priority;
- const char *url, *status_string;
+ const char *url;
priv = tedit->priv;
@@ -810,10 +807,8 @@ fill_widgets (TaskEditor *tedit)
}
/* Status. */
- cal_component_get_status (priv->comp, &status_string);
- if (status_string) {
- status = status_string_to_value (status_string);
- } else {
+ cal_component_get_status (priv->comp, &status);
+ if (status == ICAL_STATUS_NONE) {
/* Try to user the percent value. */
if (percent) {
if (*percent == 0)
@@ -822,9 +817,8 @@ fill_widgets (TaskEditor *tedit)
status = ICAL_STATUS_COMPLETED;
else
status = ICAL_STATUS_INPROCESS;
- } else {
+ } else
status = ICAL_STATUS_NEEDSACTION;
- }
}
e_dialog_option_menu_set (priv->status, status, status_map);
@@ -892,7 +886,6 @@ dialog_to_comp_object (TaskEditor *tedit)
int priority_value, percent;
CalComponentClassification classification;
char *url;
- const char *status_string;
char *str;
priv = tedit->priv;
@@ -975,8 +968,7 @@ dialog_to_comp_object (TaskEditor *tedit)
/* Status. */
status = e_dialog_option_menu_get (priv->status, status_map);
- status_string = status_value_to_string (status);
- cal_component_set_status (comp, status_string);
+ cal_component_set_status (comp, status);
/* Priority. */
priority = e_dialog_option_menu_get (priv->priority, priority_map);
@@ -1117,36 +1109,6 @@ priority_index_to_value (TaskEditorPriority priority)
}
-static int
-status_string_to_value (const char *status_string)
-{
- int i;
-
- for (i = 0; status_map[i] != -1; i++) {
- if (!strcmp (status_string_map[i], status_string))
- return status_map[i];
- }
-
- g_warning ("Invalid todo status string");
- return ICAL_STATUS_NEEDSACTION;
-}
-
-
-static const char*
-status_value_to_string (int status)
-{
- int i;
-
- for (i = 0; status_map[i] != -1; i++) {
- if (status_map[i] == status)
- return status_string_map[i];
- }
-
- g_warning ("Invalid todo status value");
- return NULL;
-}
-
-
static void
completed_changed (EDateEdit *dedit,
TaskEditor *tedit)
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
index a19763344c..ced1431292 100644
--- a/calendar/gui/e-itip-control.c
+++ b/calendar/gui/e-itip-control.c
@@ -12,7 +12,6 @@
#include <gnome.h>
#include <bonobo.h>
#include <glade/glade.h>
-#include <icaltypes.h>
#include <ical.h>
#include <time.h>
#include <Evolution-Composer.h>
diff --git a/calendar/gui/e-meeting-edit.c b/calendar/gui/e-meeting-edit.c
index efe41bbf09..abff825a29 100644
--- a/calendar/gui/e-meeting-edit.c
+++ b/calendar/gui/e-meeting-edit.c
@@ -22,7 +22,6 @@
#include <config.h>
#include <gnome.h>
#include <glade/glade.h>
-#include <icaltypes.h>
#include <ical.h>
#include <widgets/meeting-time-sel/e-meeting-time-sel.h>
#include <Evolution-Composer.h>
diff --git a/calendar/gui/itip-utils.h b/calendar/gui/itip-utils.h
index 0d2b073e4f..146cb68154 100644
--- a/calendar/gui/itip-utils.h
+++ b/calendar/gui/itip-utils.h
@@ -3,7 +3,6 @@
#define ITIP_UTILS_HEADER
#include <config.h>
-#include <icaltypes.h>
#include <ical.h>
#include <string.h>
#include <gnome.h>