author | eilers <eilers> | 2003-12-22 10:19:25 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-12-22 10:19:25 (UTC) |
commit | ae70312b1613e26b4ef89a2c9821d9531b82e987 (patch) (unidiff) | |
tree | 7eb70bc45ee29e94da27a18b0136eb4a14e59fa6 /libopie/pim/otimezone.cpp | |
parent | 9e7aafdb7c76d29fee742d53131a73dd60aded2b (diff) | |
download | opie-ae70312b1613e26b4ef89a2c9821d9531b82e987.zip opie-ae70312b1613e26b4ef89a2c9821d9531b82e987.tar.gz opie-ae70312b1613e26b4ef89a2c9821d9531b82e987.tar.bz2 |
Finishing implementation of sql-backend for datebook. But I have to
port the PIM datebook application to use it, before I could debug the
whole stuff.
Thus, PIM-Database backend is finished, but highly experimental. And some
parts are still generic. For instance, the "queryByExample()" methods are
not (or not fully) implemented. Todo: custom-entries not stored.
The big show stopper: matchRegExp() (needed by OpieSearch) needs regular
expression search in the database, which is not supported by sqlite !
Therefore we need either an extended sqlite or a workaround which would
be very slow and memory consuming..
-rw-r--r-- | libopie/pim/otimezone.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libopie/pim/otimezone.cpp b/libopie/pim/otimezone.cpp index b2bd3aa..34659c3 100644 --- a/libopie/pim/otimezone.cpp +++ b/libopie/pim/otimezone.cpp | |||
@@ -16,11 +16,16 @@ namespace { | |||
16 | } | 16 | } |
17 | QDateTime utcTime( time_t t, const QString& zone) { | 17 | QDateTime utcTime( time_t t, const QString& zone) { |
18 | QCString org = ::getenv( "TZ" ); | 18 | QCString org = ::getenv( "TZ" ); |
19 | #ifndef Q_OS_MACX // Following line causes bus errors on Mac | ||
19 | ::setenv( "TZ", zone.latin1(), true ); | 20 | ::setenv( "TZ", zone.latin1(), true ); |
20 | ::tzset(); | 21 | ::tzset(); |
21 | 22 | ||
22 | tm* broken = ::localtime( &t ); | 23 | tm* broken = ::localtime( &t ); |
23 | ::setenv( "TZ", org, true ); | 24 | ::setenv( "TZ", org, true ); |
25 | #else | ||
26 | #warning "Need a replacement for MacOSX!!" | ||
27 | tm* broken = ::localtime( &t ); | ||
28 | #endif | ||
24 | 29 | ||
25 | QDateTime ret; | 30 | QDateTime ret; |
26 | ret.setDate( QDate( broken->tm_year + 1900, broken->tm_mon +1, broken->tm_mday ) ); | 31 | ret.setDate( QDate( broken->tm_year + 1900, broken->tm_mon +1, broken->tm_mday ) ); |
@@ -41,12 +46,16 @@ namespace { | |||
41 | broken.tm_sec = t.second(); | 46 | broken.tm_sec = t.second(); |
42 | 47 | ||
43 | QCString org = ::getenv( "TZ" ); | 48 | QCString org = ::getenv( "TZ" ); |
49 | #ifndef Q_OS_MACX // Following line causes bus errors on Mac | ||
44 | ::setenv( "TZ", str.latin1(), true ); | 50 | ::setenv( "TZ", str.latin1(), true ); |
45 | ::tzset(); | 51 | ::tzset(); |
46 | 52 | ||
47 | time_t ti = ::mktime( &broken ); | 53 | time_t ti = ::mktime( &broken ); |
48 | ::setenv( "TZ", org, true ); | 54 | ::setenv( "TZ", org, true ); |
49 | 55 | #else | |
56 | #warning "Need a replacement for MacOSX!!" | ||
57 | time_t ti = ::mktime( &broken ); | ||
58 | #endif | ||
50 | return ti; | 59 | return ti; |
51 | } | 60 | } |
52 | } | 61 | } |