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 /libopie2/opiepim/backend/odatebookaccessbackend.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..
Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/odatebookaccessbackend.cpp | 34 |
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 | |||
@@ -124,27 +124,53 @@ ODateBookAccessBackend::ODateBookAccessBackend() | |||
124 | { | 124 | { |
125 | 125 | ||
126 | } | 126 | } |
127 | ODateBookAccessBackend::~ODateBookAccessBackend() { | 127 | ODateBookAccessBackend::~ODateBookAccessBackend() { |
128 | 128 | ||
129 | } | 129 | } |
130 | OEffectiveEvent::ValueList ODateBookAccessBackend::effecticeEvents( const QDate& from, | 130 | OEffectiveEvent::ValueList ODateBookAccessBackend::effectiveEvents( const QDate& from, |
131 | const QDate& to ) { | 131 | const QDate& to ) { |
132 | OEffectiveEvent::ValueList tmpList; | 132 | OEffectiveEvent::ValueList tmpList; |
133 | OEvent::ValueList list = directNonRepeats(); | 133 | OEvent::ValueList list = directNonRepeats(); |
134 | 134 | ||
135 | events( tmpList, list, from, to ); | 135 | events( tmpList, list, from, to ); |
136 | repeat( tmpList, directRawRepeats(),from,to ); | 136 | repeat( tmpList, directRawRepeats(),from,to ); |
137 | 137 | ||
138 | list = directRawRepeats(); | 138 | list = directRawRepeats(); // Useless, isn't it ? (eilers) |
139 | 139 | ||
140 | qHeapSort( tmpList ); | 140 | qHeapSort( tmpList ); |
141 | return tmpList; | 141 | return tmpList; |
142 | } | 142 | } |
143 | OEffectiveEvent::ValueList ODateBookAccessBackend::effecticeEvents( const QDateTime& dt ) { | 143 | OEffectiveEvent::ValueList ODateBookAccessBackend::effectiveEvents( const QDateTime& dt ) { |
144 | OEffectiveEvent::ValueList day = effecticeEvents( dt.date(), dt.date() ); | 144 | OEffectiveEvent::ValueList day = effectiveEvents( dt.date(), dt.date() ); |
145 | OEffectiveEvent::ValueList::Iterator it; | ||
146 | |||
147 | OEffectiveEvent::ValueList tmpList; | ||
148 | QDateTime dtTmp; | ||
149 | for ( it = day.begin(); it != day.end(); ++it ) { | ||
150 | dtTmp = QDateTime( (*it).date(), (*it).startTime() ); | ||
151 | if ( QABS(dt.secsTo(dtTmp) ) < 60 ) | ||
152 | tmpList.append( (*it) ); | ||
153 | } | ||
154 | |||
155 | return tmpList; | ||
156 | } | ||
157 | |||
158 | OEffectiveEvent::ValueList ODateBookAccessBackend::effectiveNonRepeatingEvents( const QDate& from, | ||
159 | const QDate& to ) { | ||
160 | OEffectiveEvent::ValueList tmpList; | ||
161 | OEvent::ValueList list = directNonRepeats(); | ||
162 | |||
163 | events( tmpList, list, from, to ); | ||
164 | |||
165 | qHeapSort( tmpList ); | ||
166 | return tmpList; | ||
167 | } | ||
168 | |||
169 | OEffectiveEvent::ValueList ODateBookAccessBackend::effectiveNonRepeatingEvents( const QDateTime& dt ) { | ||
170 | OEffectiveEvent::ValueList day = effectiveNonRepeatingEvents( dt.date(), dt.date() ); | ||
145 | OEffectiveEvent::ValueList::Iterator it; | 171 | OEffectiveEvent::ValueList::Iterator it; |
146 | 172 | ||
147 | OEffectiveEvent::ValueList tmpList; | 173 | OEffectiveEvent::ValueList tmpList; |
148 | QDateTime dtTmp; | 174 | QDateTime dtTmp; |
149 | for ( it = day.begin(); it != day.end(); ++it ) { | 175 | for ( it = day.begin(); it != day.end(); ++it ) { |
150 | dtTmp = QDateTime( (*it).date(), (*it).startTime() ); | 176 | dtTmp = QDateTime( (*it).date(), (*it).startTime() ); |