From 52b1ae9281920cf5a40fe543112d8b00e7699ef6 Mon Sep 17 00:00:00 2001 From: zecke Date: Thu, 29 Jul 2004 19:42:59 +0000 Subject: -UTC -> Europe/London when referring to no timezone -special handling for allDay Event in OPImEvent, avoid setting timezone as it is by default UTC -No timezone set by default for an Event -Recurrence is UTC (no timezone) -Provide upgrade path from DateBook as by default events were in the current timezone but didn't have the timezone attribute -unified handling of timezones, compatible with QtopiaDesktop -do less conversions -... --- (limited to 'libopie2/opiepim/core/opimtimezone.cpp') diff --git a/libopie2/opiepim/core/opimtimezone.cpp b/libopie2/opiepim/core/opimtimezone.cpp index fefceb5..5b32b1f 100644 --- a/libopie2/opiepim/core/opimtimezone.cpp +++ b/libopie2/opiepim/core/opimtimezone.cpp @@ -48,6 +48,7 @@ QDateTime utcTime( time_t t ) ret.setTime( QTime( broken->tm_hour, broken->tm_min, broken->tm_sec ) ); return ret; } + QDateTime utcTime( time_t t, const QString& zone ) { QCString org = ::getenv( "TZ" ); @@ -70,6 +71,8 @@ QDateTime utcTime( time_t t, const QString& zone ) return ret; } + + time_t to_Time_t( const QDateTime& utc, const QString& str ) { QDate d = utc.date(); @@ -151,9 +154,8 @@ QDateTime OPimTimeZone::toDateTime( time_t t ) */ QDateTime OPimTimeZone::toDateTime( const QDateTime& dt, const OPimTimeZone& zone ) { - time_t utc = to_Time_t( dt, zone.m_name ); - owarn << "" << utc << " " << zone.m_name << "" << oendl; - return utcTime( utc, m_name ); + time_t utc = to_Time_t( dt, m_name ); + return utcTime( utc, zone.m_name ); } @@ -165,7 +167,7 @@ time_t OPimTimeZone::fromDateTime( const QDateTime& time ) time_t OPimTimeZone::fromUTCDateTime( const QDateTime& time ) { - return to_Time_t( time, "UTC" ); + return to_Time_t( time, "Europe/London" ); } @@ -179,7 +181,7 @@ OPimTimeZone OPimTimeZone::current() OPimTimeZone OPimTimeZone::utc() { - return OPimTimeZone( "UTC" ); + return OPimTimeZone( "Europe/London" ); } -- cgit v0.9.0.2