author | ar <ar> | 2004-06-01 22:21:23 (UTC) |
---|---|---|
committer | ar <ar> | 2004-06-01 22:21:23 (UTC) |
commit | d4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce (patch) (unidiff) | |
tree | 4bab082304716df1ec924ef040161e3cf9c10366 /libopie2/opiepim/core/opimaccesstemplate.h | |
parent | baed1d5ab8589aef14440009bc4e7380bcc5a741 (diff) | |
download | opie-d4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce.zip opie-d4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce.tar.gz opie-d4fe7d53ddf8f3e7ae046a511f0dc061f30d45ce.tar.bz2 |
- convert to odebug framework
Diffstat (limited to 'libopie2/opiepim/core/opimaccesstemplate.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimaccesstemplate.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h index e438980..55d600a 100644 --- a/libopie2/opiepim/core/opimaccesstemplate.h +++ b/libopie2/opiepim/core/opimaccesstemplate.h | |||
@@ -1,16 +1,16 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) Holger Freyther <zecke@handhelds.org> | 3 | Copyright (C) Holger Freyther <zecke@handhelds.org> |
4 | Copyright (C) Stefan Eilers <eilers.stefan@epost.de> | 4 | Copyright (C) Stefan Eilers <eilers.stefan@epost.de> |
5 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | 5 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
@@ -21,32 +21,35 @@ | |||
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | */ | 29 | */ |
30 | #ifndef OPIE_PIM_ACCESS_TEMPLATE_H | 30 | #ifndef OPIE_PIM_ACCESS_TEMPLATE_H |
31 | #define OPIE_PIM_ACCESS_TEMPLATE_H | 31 | #define OPIE_PIM_ACCESS_TEMPLATE_H |
32 | 32 | ||
33 | #include <qarray.h> | 33 | /* OPIE */ |
34 | |||
35 | #include <opie2/opimrecord.h> | 34 | #include <opie2/opimrecord.h> |
36 | #include <opie2/opimaccessbackend.h> | 35 | #include <opie2/opimaccessbackend.h> |
37 | #include <opie2/opimrecordlist.h> | 36 | #include <opie2/opimrecordlist.h> |
38 | 37 | ||
39 | #include <opie2/opimcache.h> | 38 | #include <opie2/opimcache.h> |
40 | #include <opie2/opimtemplatebase.h> | 39 | #include <opie2/opimtemplatebase.h> |
40 | #include <opie2/odebug.h> | ||
41 | |||
42 | /* QT */ | ||
43 | #include <qarray.h> | ||
41 | 44 | ||
42 | namespace Opie { | 45 | namespace Opie { |
43 | 46 | ||
44 | class OPimAccessTemplatePrivate; | 47 | class OPimAccessTemplatePrivate; |
45 | /** | 48 | /** |
46 | * Thats the frontend to our OPIE PIM | 49 | * Thats the frontend to our OPIE PIM |
47 | * Library. Either you want to use it's | 50 | * Library. Either you want to use it's |
48 | * interface or you want to implement | 51 | * interface or you want to implement |
49 | * your own Access lib | 52 | * your own Access lib |
50 | * Just create a OPimRecord and inherit from | 53 | * Just create a OPimRecord and inherit from |
51 | * the templates | 54 | * the templates |
52 | */ | 55 | */ |
@@ -196,36 +199,36 @@ private: | |||
196 | 199 | ||
197 | }; | 200 | }; |
198 | 201 | ||
199 | template <class T> | 202 | template <class T> |
200 | OPimAccessTemplate<T>::OPimAccessTemplate( BackEnd* end ) | 203 | OPimAccessTemplate<T>::OPimAccessTemplate( BackEnd* end ) |
201 | : OTemplateBase<T>(), m_backEnd( end ) | 204 | : OTemplateBase<T>(), m_backEnd( end ) |
202 | { | 205 | { |
203 | if (end ) | 206 | if (end ) |
204 | end->setFrontend( this ); | 207 | end->setFrontend( this ); |
205 | } | 208 | } |
206 | template <class T> | 209 | template <class T> |
207 | OPimAccessTemplate<T>::~OPimAccessTemplate() { | 210 | OPimAccessTemplate<T>::~OPimAccessTemplate() { |
208 | qWarning("~OPimAccessTemplate<T>"); | 211 | owarn << "~OPimAccessTemplate<T>" << oendl; |
209 | delete m_backEnd; | 212 | delete m_backEnd; |
210 | } | 213 | } |
211 | template <class T> | 214 | template <class T> |
212 | bool OPimAccessTemplate<T>::load() { | 215 | bool OPimAccessTemplate<T>::load() { |
213 | invalidateCache(); | 216 | invalidateCache(); |
214 | return m_backEnd->load(); | 217 | return m_backEnd->load(); |
215 | } | 218 | } |
216 | template <class T> | 219 | template <class T> |
217 | bool OPimAccessTemplate<T>::reload() { | 220 | bool OPimAccessTemplate<T>::reload() { |
218 | invalidateCache(); // zecke: I think this should be added (se) | 221 | invalidateCache(); // zecke: I think this should be added (se) |
219 | return m_backEnd->reload(); | 222 | return m_backEnd->reload(); |
220 | } | 223 | } |
221 | template <class T> | 224 | template <class T> |
222 | bool OPimAccessTemplate<T>::save() { | 225 | bool OPimAccessTemplate<T>::save() { |
223 | return m_backEnd->save(); | 226 | return m_backEnd->save(); |
224 | } | 227 | } |
225 | template <class T> | 228 | template <class T> |
226 | typename OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const { | 229 | typename OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const { |
227 | QArray<int> ints = m_backEnd->allRecords(); | 230 | QArray<int> ints = m_backEnd->allRecords(); |
228 | List lis(ints, this ); | 231 | List lis(ints, this ); |
229 | return lis; | 232 | return lis; |
230 | } | 233 | } |
231 | template <class T> | 234 | template <class T> |
@@ -251,25 +254,25 @@ T OPimAccessTemplate<T>::find( int uid ) const{ | |||
251 | T t = m_backEnd->find( uid ); | 254 | T t = m_backEnd->find( uid ); |
252 | cache( t ); | 255 | cache( t ); |
253 | return t; | 256 | return t; |
254 | } | 257 | } |
255 | template <class T> | 258 | template <class T> |
256 | T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar, | 259 | T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar, |
257 | uint current, typename OTemplateBase<T>::CacheDirection dir )const { | 260 | uint current, typename OTemplateBase<T>::CacheDirection dir )const { |
258 | /* | 261 | /* |
259 | * better do T.isEmpty() | 262 | * better do T.isEmpty() |
260 | * after a find this way we would | 263 | * after a find this way we would |
261 | * avoid two finds in QCache... | 264 | * avoid two finds in QCache... |
262 | */ | 265 | */ |
263 | // qWarning("find it now %d", uid ); | 266 | // owarn << "find it now " << uid << oendl; |
264 | if (m_cache.contains( uid ) ) { | 267 | if (m_cache.contains( uid ) ) { |
265 | return m_cache.find( uid ); | 268 | return m_cache.find( uid ); |
266 | } | 269 | } |
267 | 270 | ||
268 | T t = m_backEnd->find( uid, ar, current, dir ); | 271 | T t = m_backEnd->find( uid, ar, current, dir ); |
269 | cache( t ); | 272 | cache( t ); |
270 | return t; | 273 | return t; |
271 | } | 274 | } |
272 | template <class T> | 275 | template <class T> |
273 | void OPimAccessTemplate<T>::clear() { | 276 | void OPimAccessTemplate<T>::clear() { |
274 | invalidateCache(); | 277 | invalidateCache(); |
275 | m_backEnd->clear(); | 278 | m_backEnd->clear(); |