author | zecke <zecke> | 2002-10-19 00:08:35 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-19 00:08:35 (UTC) |
commit | 549472ef07703ef27dc5f58a37e8f16c714fb2a1 (patch) (side-by-side diff) | |
tree | 9742f2545ef3504e61a07cef2996aa29b9db5b90 /libopie | |
parent | 598cfa66b57d61e15bc3c5ea3a9c8e7295864455 (diff) | |
download | opie-549472ef07703ef27dc5f58a37e8f16c714fb2a1.zip opie-549472ef07703ef27dc5f58a37e8f16c714fb2a1.tar.gz opie-549472ef07703ef27dc5f58a37e8f16c714fb2a1.tar.bz2 |
Add void setReadAhead(uint) to the templates
OTodoAccessSQL use the read ahead value
-rw-r--r-- | libopie/pim/opimaccessbackend.h | 16 | ||||
-rw-r--r-- | libopie/pim/opimaccesstemplate.h | 7 | ||||
-rw-r--r-- | libopie/pim/otodoaccesssql.cpp | 2 |
3 files changed, 22 insertions, 3 deletions
diff --git a/libopie/pim/opimaccessbackend.h b/libopie/pim/opimaccessbackend.h index 27d3cb8..0bd2723 100644 --- a/libopie/pim/opimaccessbackend.h +++ b/libopie/pim/opimaccessbackend.h @@ -85,2 +85,6 @@ public: + /** + * set the read ahead count + */ + void setReadAhead( uint count ); protected: @@ -93,4 +97,7 @@ protected: + uint readAhead()const; + private: Frontend* m_front; + uint m_read; @@ -125,3 +132,10 @@ T OPimAccessBackend<T>::find( int uid, const QArray<int>&, } - +template <class T> +void OPimAccessBackend<T>::setReadAhead( uint count ) { + m_read = count; +} +template <class T> +uint OPimAccessBackend<T>::readAhead()const { + return m_read; +} #endif diff --git a/libopie/pim/opimaccesstemplate.h b/libopie/pim/opimaccesstemplate.h index 50cb1e4..c5523a8 100644 --- a/libopie/pim/opimaccesstemplate.h +++ b/libopie/pim/opimaccesstemplate.h @@ -67,3 +67,3 @@ public: /** - * queryByExample. + * queryByExample. * @see otodoaccess, ocontactaccess @@ -118,2 +118,3 @@ public: + void setReadAhead( uint count ); /** @@ -253,2 +254,6 @@ void OPimAccessTemplate<T>::setSaneCacheSize( int size ) { } +template <class T> +void OPimAccessTemplate<T>::setReadAhead( uint count ) { + m_backEnd->setReadAhead( count ); +} #endif diff --git a/libopie/pim/otodoaccesssql.cpp b/libopie/pim/otodoaccesssql.cpp index 9ef6b7c..8c2ea3a 100644 --- a/libopie/pim/otodoaccesssql.cpp +++ b/libopie/pim/otodoaccesssql.cpp @@ -288,5 +288,5 @@ OTodo OTodoAccessBackendSQL::find(int uid ) const{ } -#define CACHE 32 OTodo OTodoAccessBackendSQL::find( int uid, const QArray<int>& ints, uint cur, Frontend::CacheDirection dir ) const{ + int CACHE = readAhead(); qWarning("searching for %d", uid ); |