aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/mark.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@src.gnome.org>2000-05-24 04:52:12 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-05-24 04:52:12 +0800
commit910e86eba685c2eddbd9ebd48b25391490d5f24b (patch)
tree4f9f9106343ce0f4615b333e18e329ce4b07a07d /calendar/gui/mark.c
parent46700211974920a7a79c82d2ad4420934d3e7266 (diff)
downloadgsoc2013-evolution-910e86eba685c2eddbd9ebd48b25391490d5f24b.tar.gz
gsoc2013-evolution-910e86eba685c2eddbd9ebd48b25391490d5f24b.tar.zst
gsoc2013-evolution-910e86eba685c2eddbd9ebd48b25391490d5f24b.zip
Commit for if my laptop dies - Federico
svn path=/trunk/; revision=3185
Diffstat (limited to 'calendar/gui/mark.c')
-rw-r--r--calendar/gui/mark.c42
1 files changed, 31 insertions, 11 deletions
diff --git a/calendar/gui/mark.c b/calendar/gui/mark.c
index 02b3af17e1..ea83845b2a 100644
--- a/calendar/gui/mark.c
+++ b/calendar/gui/mark.c
@@ -1,8 +1,22 @@
-/* Functions to mark calendars
+/* Evolution calendar - Functions to mark calendars
*
* Copyright (C) 1998 Red Hat Software, Inc.
*
- * Author: Federico Mena <federico@nuclecu.unam.mx>
+ * Author: Federico Mena-Quintero <federico@helixcode.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*/
#include <config.h>
@@ -11,6 +25,7 @@
#include "calendar-commands.h"
#include "mark.h"
+
/* Frees the specified data when an object is destroyed */
static void
@@ -101,30 +116,35 @@ mark_event_in_month (GnomeMonthItem *mitem, time_t start, time_t end)
}
void
-mark_month_item (GnomeMonthItem *mitem, GnomeCalendar *cal)
+mark_month_item (GnomeMonthItem *mitem, GnomeCalendar *gcal)
{
time_t month_begin, month_end;
- GList *list, *l;
- CalendarObject *co;
+ GList *events;
+ GList *l;
g_return_if_fail (mitem != NULL);
g_return_if_fail (GNOME_IS_MONTH_ITEM (mitem));
- g_return_if_fail (cal != NULL);
+ g_return_if_fail (gcal != NULL);
+ g_return_if_fail (GNOME_IS_CALENDAR (gcal));
month_begin = time_month_begin (time_from_day (mitem->year, mitem->month, 1));
month_end = time_month_end (month_begin);
- list = calendar_get_events_in_range (cal->client, month_begin, month_end);
+ events = cal_client_get_events_in_range (gcal->client, month_begin, month_end);
+
+ for (l = events; l; l = l->next) {
+ CalObjInstance *coi;
- for (l = list; l; l = l->next) {
- co = l->data;
+ coi = l->data;
/* We clip the event's start and end times to the month's limits */
- mark_event_in_month (mitem, MAX (co->ev_start, month_begin), MIN (co->ev_end, month_end));
+ mark_event_in_month (mitem,
+ MAX (coi->start, month_begin),
+ MIN (coi->end, month_end));
}
- /* calendar_destroy_event_list (list); DELETE / FIX ME */
+ cal_obj_instance_list_free (events);
}
void