aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-04-03 05:00:59 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-03 05:00:59 +0800
commit2ff4c25c6c79ea6bcb58a155d1e60e6a0eec9e6f (patch)
treec02002308eb47968fb985416eeeb3099d85281f3
parentf6963100c2509175cbd22b1556273ddbc0dd4e7d (diff)
downloadgsoc2013-evolution-2ff4c25c6c79ea6bcb58a155d1e60e6a0eec9e6f.tar.gz
gsoc2013-evolution-2ff4c25c6c79ea6bcb58a155d1e60e6a0eec9e6f.tar.zst
gsoc2013-evolution-2ff4c25c6c79ea6bcb58a155d1e60e6a0eec9e6f.zip
Various time fixes; lib fixes; cache fixes -mig
svn path=/trunk/; revision=96
-rw-r--r--calendar/cal-util/calobj.c2
-rw-r--r--calendar/calobj.c2
-rw-r--r--calendar/gncal-day-view.c4
-rw-r--r--calendar/gui/gncal-day-view.c4
-rw-r--r--calendar/pcs/calobj.c2
-rw-r--r--calendar/timeutil.c15
6 files changed, 23 insertions, 6 deletions
diff --git a/calendar/cal-util/calobj.c b/calendar/cal-util/calobj.c
index 2f4647548f..f405dbe265 100644
--- a/calendar/cal-util/calobj.c
+++ b/calendar/cal-util/calobj.c
@@ -63,7 +63,7 @@ set_list (char *str, char *sc)
}
#define is_a_prop_of(obj,prop) isAPropertyOf (obj,prop)
-#define str_val(obj) (char *) vObjectUStringZValue (obj)
+#define str_val(obj) fakeCString (vObjectUStringZValue (obj))
#define has(obj,prop) (vo = isAPropertyOf (obj, prop))
/* FIXME: we need to load the recurrence properties */
diff --git a/calendar/calobj.c b/calendar/calobj.c
index 2f4647548f..f405dbe265 100644
--- a/calendar/calobj.c
+++ b/calendar/calobj.c
@@ -63,7 +63,7 @@ set_list (char *str, char *sc)
}
#define is_a_prop_of(obj,prop) isAPropertyOf (obj,prop)
-#define str_val(obj) (char *) vObjectUStringZValue (obj)
+#define str_val(obj) fakeCString (vObjectUStringZValue (obj))
#define has(obj,prop) (vo = isAPropertyOf (obj, prop))
/* FIXME: we need to load the recurrence properties */
diff --git a/calendar/gncal-day-view.c b/calendar/gncal-day-view.c
index eef854322d..209b6be40a 100644
--- a/calendar/gncal-day-view.c
+++ b/calendar/gncal-day-view.c
@@ -113,6 +113,7 @@ gncal_day_view_new (GnomeCalendar *calendar, time_t lower, time_t upper)
dview->lower = lower;
dview->upper = upper;
dview->events = 0;
+
gncal_day_view_update (dview);
return GTK_WIDGET (dview);
@@ -286,6 +287,9 @@ gncal_day_view_update (GncalDayView *dview)
g_return_if_fail (dview != NULL);
g_return_if_fail (GNCAL_IS_DAY_VIEW (dview));
+ if (!dview->calendar->cal)
+ return;
+
if (dview->day_str)
g_free (dview->day_str);
diff --git a/calendar/gui/gncal-day-view.c b/calendar/gui/gncal-day-view.c
index eef854322d..209b6be40a 100644
--- a/calendar/gui/gncal-day-view.c
+++ b/calendar/gui/gncal-day-view.c
@@ -113,6 +113,7 @@ gncal_day_view_new (GnomeCalendar *calendar, time_t lower, time_t upper)
dview->lower = lower;
dview->upper = upper;
dview->events = 0;
+
gncal_day_view_update (dview);
return GTK_WIDGET (dview);
@@ -286,6 +287,9 @@ gncal_day_view_update (GncalDayView *dview)
g_return_if_fail (dview != NULL);
g_return_if_fail (GNCAL_IS_DAY_VIEW (dview));
+ if (!dview->calendar->cal)
+ return;
+
if (dview->day_str)
g_free (dview->day_str);
diff --git a/calendar/pcs/calobj.c b/calendar/pcs/calobj.c
index 2f4647548f..f405dbe265 100644
--- a/calendar/pcs/calobj.c
+++ b/calendar/pcs/calobj.c
@@ -63,7 +63,7 @@ set_list (char *str, char *sc)
}
#define is_a_prop_of(obj,prop) isAPropertyOf (obj,prop)
-#define str_val(obj) (char *) vObjectUStringZValue (obj)
+#define str_val(obj) fakeCString (vObjectUStringZValue (obj))
#define has(obj,prop) (vo = isAPropertyOf (obj, prop))
/* FIXME: we need to load the recurrence properties */
diff --git a/calendar/timeutil.c b/calendar/timeutil.c
index 7957751049..7d39ea9814 100644
--- a/calendar/timeutil.c
+++ b/calendar/timeutil.c
@@ -15,9 +15,10 @@ time_t
time_from_isodate (char *str)
{
struct tm my_tm;
+ time_t t;
- my_tm.tm_year = digit_at (str, 0) * 1000 + digit_at (str, 1) * 100 +
- digit_at (str, 2) * 10 + digit_at (str, 3);
+ my_tm.tm_year = (digit_at (str, 0) * 1000 + digit_at (str, 1) * 100 +
+ digit_at (str, 2) * 10 + digit_at (str, 3)) - 1900;
my_tm.tm_mon = digit_at (str, 4) * 10 + digit_at (str, 5);
my_tm.tm_mday = digit_at (str, 6) * 10 + digit_at (str, 7);
@@ -26,7 +27,15 @@ time_from_isodate (char *str)
my_tm.tm_sec = digit_at (str, 13) * 10 + digit_at (str, 14);
my_tm.tm_isdst = -1;
- return mktime (&my_tm);
+ t = mktime (&my_tm);
+ {
+ struct tm *tm = localtime (&t);
+
+ printf ("TIEMPO: %d/%d/%d %d:%d:%d\n",
+ tm->tm_mday, tm->tm_mon, tm->tm_year,
+ tm->tm_hour, tm->tm_min, tm->tm_sec);
+ }
+ return t;
}
char *