summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core
Unidiff
Diffstat (limited to 'libopie2/opiepim/core') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/ocontactaccess.h14
-rw-r--r--libopie2/opiepim/core/odatebookaccess.cpp19
-rw-r--r--libopie2/opiepim/core/odatebookaccess.h9
-rw-r--r--libopie2/opiepim/core/otimezone.cpp11
4 files changed, 46 insertions, 7 deletions
diff --git a/libopie2/opiepim/core/ocontactaccess.h b/libopie2/opiepim/core/ocontactaccess.h
index 9b0a719..bd6da40 100644
--- a/libopie2/opiepim/core/ocontactaccess.h
+++ b/libopie2/opiepim/core/ocontactaccess.h
@@ -17,6 +17,18 @@
17 * ===================================================================== 17 * =====================================================================
18 * History: 18 * History:
19 * $Log$ 19 * $Log$
20 * Revision 1.10 2003/12/22 10:19:26 eilers
21 * Finishing implementation of sql-backend for datebook. But I have to
22 * port the PIM datebook application to use it, before I could debug the
23 * whole stuff.
24 * Thus, PIM-Database backend is finished, but highly experimental. And some
25 * parts are still generic. For instance, the "queryByExample()" methods are
26 * not (or not fully) implemented. Todo: custom-entries not stored.
27 * The big show stopper: matchRegExp() (needed by OpieSearch) needs regular
28 * expression search in the database, which is not supported by sqlite !
29 * Therefore we need either an extended sqlite or a workaround which would
30 * be very slow and memory consuming..
31 *
20 * Revision 1.9 2003/08/01 12:30:16 eilers 32 * Revision 1.9 2003/08/01 12:30:16 eilers
21 * Merging changes from BRANCH_1_0 to HEAD 33 * Merging changes from BRANCH_1_0 to HEAD
22 * 34 *
@@ -78,7 +90,7 @@
78 * done by the backend. 90 * done by the backend.
79 * This class is used to access the Contacts on a system. This class as any OPIE PIM 91 * This class is used to access the Contacts on a system. This class as any OPIE PIM
80 * class is backend independent. 92 * class is backend independent.
81 93 * @author Stefan Eilers, Holger Freyther
82 * @see OPimAccessTemplate 94 * @see OPimAccessTemplate
83 */ 95 */
84class OContactAccess: public QObject, public OPimAccessTemplate<OContact> 96class OContactAccess: public QObject, public OPimAccessTemplate<OContact>
diff --git a/libopie2/opiepim/core/odatebookaccess.cpp b/libopie2/opiepim/core/odatebookaccess.cpp
index a3661a3..82934f9 100644
--- a/libopie2/opiepim/core/odatebookaccess.cpp
+++ b/libopie2/opiepim/core/odatebookaccess.cpp
@@ -56,11 +56,26 @@ ODateBookAccess::List ODateBookAccess::nonRepeats()const {
56 * @param to Include all events to... 56 * @param to Include all events to...
57 */ 57 */
58OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDate& from, const QDate& to ) { 58OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDate& from, const QDate& to ) {
59 return m_backEnd->effecticeEvents( from, to ); 59 return m_backEnd->effectiveEvents( from, to );
60} 60}
61/** 61/**
62 * @return all events at a given datetime 62 * @return all events at a given datetime
63 */ 63 */
64OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDateTime& start ) { 64OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDateTime& start ) {
65 return m_backEnd->effecticeEvents( start ); 65 return m_backEnd->effectiveEvents( start );
66}
67
68/**
69 * @return non repeating dates in the time span between from and to
70 * @param from Include all events from...
71 * @param to Include all events to...
72 */
73OEffectiveEvent::ValueList ODateBookAccess::effectiveNonRepeatingEvents( const QDate& from, const QDate& to ) {
74 return m_backEnd->effectiveNonRepeatingEvents( from, to );
75}
76/**
77 * @return all non repeating events at a given datetime
78 */
79OEffectiveEvent::ValueList ODateBookAccess::effectiveNonRepeatingEvents( const QDateTime& start ) {
80 return m_backEnd->effectiveNonRepeatingEvents( start );
66} 81}
diff --git a/libopie2/opiepim/core/odatebookaccess.h b/libopie2/opiepim/core/odatebookaccess.h
index 7c7a63f..62196da 100644
--- a/libopie2/opiepim/core/odatebookaccess.h
+++ b/libopie2/opiepim/core/odatebookaccess.h
@@ -13,7 +13,7 @@
13 * Make sure to load and save the datebook this is not part of 13 * Make sure to load and save the datebook this is not part of
14 * destructing and creating the object 14 * destructing and creating the object
15 * 15 *
16 * @author Holger Freyther 16 * @author Holger Freyther, Stefan Eilers
17 */ 17 */
18class ODateBookAccess : public OPimAccessTemplate<OEvent> { 18class ODateBookAccess : public OPimAccessTemplate<OEvent> {
19public: 19public:
@@ -29,8 +29,11 @@ public:
29 /* return non repeating events */ 29 /* return non repeating events */
30 List nonRepeats()const; 30 List nonRepeats()const;
31 31
32 OEffectiveEvent::ValueList effectiveEvents( const QDate& from, const QDate& to ); 32 /* return non repeating events (from,to) */
33 OEffectiveEvent::ValueList effectiveEvents( const QDateTime& start ); 33 OEffectiveEvent::ValueList effectiveEvents( const QDate& from, const QDate& to ) const;
34 OEffectiveEvent::ValueList effectiveEvents( const QDateTime& start ) const;
35 OEffectiveEvent::ValueList effectiveNonRepeatingEvents( const QDate& from, const QDate& to ) const;
36 OEffectiveEvent::ValueList effectiveNonRepeatingEvents( const QDateTime& start ) const;
34 37
35private: 38private:
36 ODateBookAccessBackend* m_backEnd; 39 ODateBookAccessBackend* m_backEnd;
diff --git a/libopie2/opiepim/core/otimezone.cpp b/libopie2/opiepim/core/otimezone.cpp
index b2bd3aa..34659c3 100644
--- a/libopie2/opiepim/core/otimezone.cpp
+++ b/libopie2/opiepim/core/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}