aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-04-23 10:32:32 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-23 10:32:32 +0800
commitc79a97a8e1983a8c28bb11afe95d3eb3675b15e7 (patch)
treec77f5e73636698eff484742ef19ea864313e0869
parent017a40b429a28c7b69abee005262794dde049e15 (diff)
downloadgsoc2013-evolution-c79a97a8e1983a8c28bb11afe95d3eb3675b15e7.tar.gz
gsoc2013-evolution-c79a97a8e1983a8c28bb11afe95d3eb3675b15e7.tar.zst
gsoc2013-evolution-c79a97a8e1983a8c28bb11afe95d3eb3675b15e7.zip
Fixes for vTodo thingies -mig
svn path=/trunk/; revision=190
-rw-r--r--calendar/cal-util/calobj.c25
-rw-r--r--calendar/calobj.c25
-rw-r--r--calendar/gui/year-view.c2
-rw-r--r--calendar/pcs/calobj.c25
-rw-r--r--calendar/year-view.c2
5 files changed, 56 insertions, 23 deletions
diff --git a/calendar/cal-util/calobj.c b/calendar/cal-util/calobj.c
index cb1bd8b560..f3098047bd 100644
--- a/calendar/cal-util/calobj.c
+++ b/calendar/cal-util/calobj.c
@@ -483,12 +483,19 @@ ical_object_create_from_vobject (VObject *o, const char *object_name)
ical->dtstart = 0;
/* dtend */
- if (has (o, VCDTendProp)){
- ical->dtend = time_from_isodate (str_val (vo));
- free (the_str);
- } else
- ical->dtend = 0;
-
+ ical->dtend = 0; /* default value */
+ if (ical->type == ICAL_EVENT){
+ if (has (o, VCDTendProp)){
+ ical->dtend = time_from_isodate (str_val (vo));
+ free (the_str);
+ }
+ } else if (ical->type == ICAL_TODO){
+ if (has (o, VCDueProp)){
+ ical->dtend = time_from_isodate (str_val (vo));
+ free (the_str);
+ }
+ }
+
/* dcreated */
if (has (o, VCDCreatedProp)){
ical->created = time_from_isodate (str_val (vo));
@@ -775,7 +782,11 @@ ical_object_to_vobject (iCalObject *ical)
addPropValue (o, VCDTstartProp, isodate_from_time_t (ical->dtstart));
/* dtend */
- addPropValue (o, VCDTendProp, isodate_from_time_t (ical->dtend));
+ if (ical->type == ICAL_EVENT){
+ addPropValue (o, VCDTendProp, isodate_from_time_t (ical->dtend));
+ } else if (ical->type == ICAL_TODO){
+ addPropValue (o, VCDueProp, isodate_from_time_t (ical->dtend));
+ }
/* dcreated */
addPropValue (o, VCDCreatedProp, isodate_from_time_t (ical->created));
diff --git a/calendar/calobj.c b/calendar/calobj.c
index cb1bd8b560..f3098047bd 100644
--- a/calendar/calobj.c
+++ b/calendar/calobj.c
@@ -483,12 +483,19 @@ ical_object_create_from_vobject (VObject *o, const char *object_name)
ical->dtstart = 0;
/* dtend */
- if (has (o, VCDTendProp)){
- ical->dtend = time_from_isodate (str_val (vo));
- free (the_str);
- } else
- ical->dtend = 0;
-
+ ical->dtend = 0; /* default value */
+ if (ical->type == ICAL_EVENT){
+ if (has (o, VCDTendProp)){
+ ical->dtend = time_from_isodate (str_val (vo));
+ free (the_str);
+ }
+ } else if (ical->type == ICAL_TODO){
+ if (has (o, VCDueProp)){
+ ical->dtend = time_from_isodate (str_val (vo));
+ free (the_str);
+ }
+ }
+
/* dcreated */
if (has (o, VCDCreatedProp)){
ical->created = time_from_isodate (str_val (vo));
@@ -775,7 +782,11 @@ ical_object_to_vobject (iCalObject *ical)
addPropValue (o, VCDTstartProp, isodate_from_time_t (ical->dtstart));
/* dtend */
- addPropValue (o, VCDTendProp, isodate_from_time_t (ical->dtend));
+ if (ical->type == ICAL_EVENT){
+ addPropValue (o, VCDTendProp, isodate_from_time_t (ical->dtend));
+ } else if (ical->type == ICAL_TODO){
+ addPropValue (o, VCDueProp, isodate_from_time_t (ical->dtend));
+ }
/* dcreated */
addPropValue (o, VCDCreatedProp, isodate_from_time_t (ical->created));
diff --git a/calendar/gui/year-view.c b/calendar/gui/year-view.c
index dd1a963d52..d28130bb6f 100644
--- a/calendar/gui/year-view.c
+++ b/calendar/gui/year-view.c
@@ -206,7 +206,7 @@ gncal_year_view_set_year (GncalYearView *yview, int year)
year_begin = time_year_begin (yview->year);
year_end = time_year_end (yview->year);
-
+
l = calendar_get_events_in_range (yview->gcal->cal, year_begin, year_end);
for (; l; l = l->next){
CalendarObject *co = l->data;
diff --git a/calendar/pcs/calobj.c b/calendar/pcs/calobj.c
index cb1bd8b560..f3098047bd 100644
--- a/calendar/pcs/calobj.c
+++ b/calendar/pcs/calobj.c
@@ -483,12 +483,19 @@ ical_object_create_from_vobject (VObject *o, const char *object_name)
ical->dtstart = 0;
/* dtend */
- if (has (o, VCDTendProp)){
- ical->dtend = time_from_isodate (str_val (vo));
- free (the_str);
- } else
- ical->dtend = 0;
-
+ ical->dtend = 0; /* default value */
+ if (ical->type == ICAL_EVENT){
+ if (has (o, VCDTendProp)){
+ ical->dtend = time_from_isodate (str_val (vo));
+ free (the_str);
+ }
+ } else if (ical->type == ICAL_TODO){
+ if (has (o, VCDueProp)){
+ ical->dtend = time_from_isodate (str_val (vo));
+ free (the_str);
+ }
+ }
+
/* dcreated */
if (has (o, VCDCreatedProp)){
ical->created = time_from_isodate (str_val (vo));
@@ -775,7 +782,11 @@ ical_object_to_vobject (iCalObject *ical)
addPropValue (o, VCDTstartProp, isodate_from_time_t (ical->dtstart));
/* dtend */
- addPropValue (o, VCDTendProp, isodate_from_time_t (ical->dtend));
+ if (ical->type == ICAL_EVENT){
+ addPropValue (o, VCDTendProp, isodate_from_time_t (ical->dtend));
+ } else if (ical->type == ICAL_TODO){
+ addPropValue (o, VCDueProp, isodate_from_time_t (ical->dtend));
+ }
/* dcreated */
addPropValue (o, VCDCreatedProp, isodate_from_time_t (ical->created));
diff --git a/calendar/year-view.c b/calendar/year-view.c
index dd1a963d52..d28130bb6f 100644
--- a/calendar/year-view.c
+++ b/calendar/year-view.c
@@ -206,7 +206,7 @@ gncal_year_view_set_year (GncalYearView *yview, int year)
year_begin = time_year_begin (yview->year);
year_end = time_year_end (yview->year);
-
+
l = calendar_get_events_in_range (yview->gcal->cal, year_begin, year_end);
for (; l; l = l->next){
CalendarObject *co = l->data;