[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    [Kde-pim] Why KOrganizer handles TZ poorly on FreeBSD
From:       Adriaan de Groot <adridg () cs ! kun ! nl>
Date:       2002-09-24 22:25:14
[Download RAW message or body]

Let's start with the patched code, in libkcal/calendar.cpp:63:

extern "C" { void set_tz(const char *tzid); } ;

void Calendar::init()
{
  set_tz(mTimeZoneId.latin1());

  mObserver = 0;

On FreeBSD systems, the environment variable TZ is normally unset, since 
/etc/localtime contains all the relevant information and you don't muck with 
it. As long as TZ is unset, the system time functions use /etc/localtime and 
it works. 

However, you also can't naively putenv("TZ") to unset values. Our libc returns 
an error, and the environment variable is left set to what it was. This means 
that because TZ is normally unset at startup, and libical keeps mucking with 
the value of TZ every time a time property is accessed, the very _first_ time 
such a thing happens, the timezone gets set to UTC (because libical tries to 
do computations in UTC) and stays that way. That's why QTime() is off in 
KOrganizer, and hence the MB line.

To test this, do TZ=MST korganizer and watch things work. Or set the timezone 
explicitly in Calendar::init(), as above. Or fix libical, that would be a 
possibility as well.

What I don't know is how setting the TZ will affect the way the calendar is 
saved. I seem to remember we used to have dreadful problems with timezones 
under Linux as well.

-- 
http://freebsd.kde.org/
_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic