summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core
Side-by-side diff
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
@@ -14,12 +14,24 @@
* ToDo: Define enum for query settings
* =====================================================================
* Version: $Id$
* =====================================================================
* History:
* $Log$
+ * Revision 1.10 2003/12/22 10:19:26 eilers
+ * 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..
+ *
* Revision 1.9 2003/08/01 12:30:16 eilers
* Merging changes from BRANCH_1_0 to HEAD
*
* Revision 1.8.2.1 2003/06/30 14:34:19 eilers
* Patches from Zecke:
* Fixing and cleaning up extraMap handling
@@ -75,13 +87,13 @@
/**
* Class to access the contacts database.
* This is just a frontend for the real database handling which is
* done by the backend.
* This class is used to access the Contacts on a system. This class as any OPIE PIM
* class is backend independent.
-
+ * @author Stefan Eilers, Holger Freyther
* @see OPimAccessTemplate
*/
class OContactAccess: public QObject, public OPimAccessTemplate<OContact>
{
Q_OBJECT
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
@@ -53,14 +53,29 @@ ODateBookAccess::List ODateBookAccess::nonRepeats()const {
/**
* @return dates in the time span between from and to
* @param from Include all events from...
* @param to Include all events to...
*/
OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDate& from, const QDate& to ) {
- return m_backEnd->effecticeEvents( from, to );
+ return m_backEnd->effectiveEvents( from, to );
}
/**
* @return all events at a given datetime
*/
OEffectiveEvent::ValueList ODateBookAccess::effectiveEvents( const QDateTime& start ) {
- return m_backEnd->effecticeEvents( start );
+ return m_backEnd->effectiveEvents( start );
+}
+
+/**
+ * @return non repeating dates in the time span between from and to
+ * @param from Include all events from...
+ * @param to Include all events to...
+ */
+OEffectiveEvent::ValueList ODateBookAccess::effectiveNonRepeatingEvents( const QDate& from, const QDate& to ) {
+ return m_backEnd->effectiveNonRepeatingEvents( from, to );
+}
+/**
+ * @return all non repeating events at a given datetime
+ */
+OEffectiveEvent::ValueList ODateBookAccess::effectiveNonRepeatingEvents( const QDateTime& start ) {
+ return m_backEnd->effectiveNonRepeatingEvents( start );
}
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
@@ -10,13 +10,13 @@
* This is the object orientated datebook database. It'll use OBackendFactory
* to query for a backend.
* All access to the datebook should be done via this class.
* Make sure to load and save the datebook this is not part of
* destructing and creating the object
*
- * @author Holger Freyther
+ * @author Holger Freyther, Stefan Eilers
*/
class ODateBookAccess : public OPimAccessTemplate<OEvent> {
public:
ODateBookAccess( ODateBookAccessBackend* = 0l, enum Access acc = Random );
~ODateBookAccess();
@@ -26,14 +26,17 @@ public:
/* return repeating events */
List rawRepeats()const;
/* return non repeating events */
List nonRepeats()const;
- OEffectiveEvent::ValueList effectiveEvents( const QDate& from, const QDate& to );
- OEffectiveEvent::ValueList effectiveEvents( const QDateTime& start );
+ /* return non repeating events (from,to) */
+ OEffectiveEvent::ValueList effectiveEvents( const QDate& from, const QDate& to ) const;
+ OEffectiveEvent::ValueList effectiveEvents( const QDateTime& start ) const;
+ OEffectiveEvent::ValueList effectiveNonRepeatingEvents( const QDate& from, const QDate& to ) const;
+ OEffectiveEvent::ValueList effectiveNonRepeatingEvents( const QDateTime& start ) const;
private:
ODateBookAccessBackend* m_backEnd;
class Private;
Private* d;
};
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
@@ -13,17 +13,22 @@ namespace {
ret.setDate( QDate( broken->tm_year + 1900, broken->tm_mon +1, broken->tm_mday ) );
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" );
+#ifndef Q_OS_MACX // Following line causes bus errors on Mac
::setenv( "TZ", zone.latin1(), true );
::tzset();
tm* broken = ::localtime( &t );
::setenv( "TZ", org, true );
+#else
+#warning "Need a replacement for MacOSX!!"
+ tm* broken = ::localtime( &t );
+#endif
QDateTime ret;
ret.setDate( QDate( broken->tm_year + 1900, broken->tm_mon +1, broken->tm_mday ) );
ret.setTime( QTime( broken->tm_hour, broken->tm_min, broken->tm_sec ) );
return ret;
@@ -38,18 +43,22 @@ namespace {
broken.tm_mday = d.day();
broken.tm_hour = t.hour();
broken.tm_min = t.minute();
broken.tm_sec = t.second();
QCString org = ::getenv( "TZ" );
+#ifndef Q_OS_MACX // Following line causes bus errors on Mac
::setenv( "TZ", str.latin1(), true );
::tzset();
time_t ti = ::mktime( &broken );
::setenv( "TZ", org, true );
-
+#else
+#warning "Need a replacement for MacOSX!!"
+ time_t ti = ::mktime( &broken );
+#endif
return ti;
}
}
OTimeZone::OTimeZone( const ZoneName& zone )
: m_name(zone) {
}