summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/odatebookaccessbackend.cpp
authoreilers <eilers>2003-12-22 10:19:25 (UTC)
committer eilers <eilers>2003-12-22 10:19:25 (UTC)
commitae70312b1613e26b4ef89a2c9821d9531b82e987 (patch) (side-by-side diff)
tree7eb70bc45ee29e94da27a18b0136eb4a14e59fa6 /libopie2/opiepim/backend/odatebookaccessbackend.cpp
parent9e7aafdb7c76d29fee742d53131a73dd60aded2b (diff)
downloadopie-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..
Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend.cpp34
1 files changed, 30 insertions, 4 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend.cpp b/libopie2/opiepim/backend/odatebookaccessbackend.cpp
index 8fa1a68..f0c5d65 100644
--- a/libopie2/opiepim/backend/odatebookaccessbackend.cpp
+++ b/libopie2/opiepim/backend/odatebookaccessbackend.cpp
@@ -127,7 +127,7 @@ ODateBookAccessBackend::ODateBookAccessBackend()
ODateBookAccessBackend::~ODateBookAccessBackend() {
}
-OEffectiveEvent::ValueList ODateBookAccessBackend::effecticeEvents( const QDate& from,
+OEffectiveEvent::ValueList ODateBookAccessBackend::effectiveEvents( const QDate& from,
const QDate& to ) {
OEffectiveEvent::ValueList tmpList;
OEvent::ValueList list = directNonRepeats();
@@ -135,13 +135,39 @@ OEffectiveEvent::ValueList ODateBookAccessBackend::effecticeEvents( const QDate&
events( tmpList, list, from, to );
repeat( tmpList, directRawRepeats(),from,to );
- list = directRawRepeats();
+ list = directRawRepeats(); // Useless, isn't it ? (eilers)
qHeapSort( tmpList );
return tmpList;
}
-OEffectiveEvent::ValueList ODateBookAccessBackend::effecticeEvents( const QDateTime& dt ) {
- OEffectiveEvent::ValueList day = effecticeEvents( dt.date(), dt.date() );
+OEffectiveEvent::ValueList ODateBookAccessBackend::effectiveEvents( const QDateTime& dt ) {
+ OEffectiveEvent::ValueList day = effectiveEvents( dt.date(), dt.date() );
+ OEffectiveEvent::ValueList::Iterator it;
+
+ OEffectiveEvent::ValueList tmpList;
+ QDateTime dtTmp;
+ for ( it = day.begin(); it != day.end(); ++it ) {
+ dtTmp = QDateTime( (*it).date(), (*it).startTime() );
+ if ( QABS(dt.secsTo(dtTmp) ) < 60 )
+ tmpList.append( (*it) );
+ }
+
+ return tmpList;
+}
+
+OEffectiveEvent::ValueList ODateBookAccessBackend::effectiveNonRepeatingEvents( const QDate& from,
+ const QDate& to ) {
+ OEffectiveEvent::ValueList tmpList;
+ OEvent::ValueList list = directNonRepeats();
+
+ events( tmpList, list, from, to );
+
+ qHeapSort( tmpList );
+ return tmpList;
+}
+
+OEffectiveEvent::ValueList ODateBookAccessBackend::effectiveNonRepeatingEvents( const QDateTime& dt ) {
+ OEffectiveEvent::ValueList day = effectiveNonRepeatingEvents( dt.date(), dt.date() );
OEffectiveEvent::ValueList::Iterator it;
OEffectiveEvent::ValueList tmpList;