-rw-r--r-- | libopie/pim/opimaccessbackend.h | 16 | ||||
-rw-r--r-- | libopie/pim/opimaccesstemplate.h | 7 | ||||
-rw-r--r-- | libopie/pim/otodoaccesssql.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiepim/backend/opimaccessbackend.h | 16 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccesssql.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimaccesstemplate.h | 7 |
6 files changed, 44 insertions, 6 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 ); diff --git a/libopie2/opiepim/backend/opimaccessbackend.h b/libopie2/opiepim/backend/opimaccessbackend.h index 27d3cb8..0bd2723 100644 --- a/libopie2/opiepim/backend/opimaccessbackend.h +++ b/libopie2/opiepim/backend/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/libopie2/opiepim/backend/otodoaccesssql.cpp b/libopie2/opiepim/backend/otodoaccesssql.cpp index 9ef6b7c..8c2ea3a 100644 --- a/libopie2/opiepim/backend/otodoaccesssql.cpp +++ b/libopie2/opiepim/backend/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 ); diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h index 50cb1e4..c5523a8 100644 --- a/libopie2/opiepim/core/opimaccesstemplate.h +++ b/libopie2/opiepim/core/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 |