-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 |
3 files changed, 22 insertions, 3 deletions
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: | |||
85 | 85 | ||
86 | /** | ||
87 | * set the read ahead count | ||
88 | */ | ||
89 | void setReadAhead( uint count ); | ||
86 | protected: | 90 | protected: |
@@ -93,4 +97,7 @@ protected: | |||
93 | 97 | ||
98 | uint readAhead()const; | ||
99 | |||
94 | private: | 100 | private: |
95 | Frontend* m_front; | 101 | Frontend* m_front; |
102 | uint m_read; | ||
96 | 103 | ||
@@ -125,3 +132,10 @@ T OPimAccessBackend<T>::find( int uid, const QArray<int>&, | |||
125 | } | 132 | } |
126 | 133 | template <class T> | |
134 | void OPimAccessBackend<T>::setReadAhead( uint count ) { | ||
135 | m_read = count; | ||
136 | } | ||
137 | template <class T> | ||
138 | uint OPimAccessBackend<T>::readAhead()const { | ||
139 | return m_read; | ||
140 | } | ||
127 | #endif | 141 | #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{ | |||
288 | } | 288 | } |
289 | #define CACHE 32 | ||
290 | OTodo OTodoAccessBackendSQL::find( int uid, const QArray<int>& ints, | 289 | OTodo OTodoAccessBackendSQL::find( int uid, const QArray<int>& ints, |
291 | uint cur, Frontend::CacheDirection dir ) const{ | 290 | uint cur, Frontend::CacheDirection dir ) const{ |
291 | int CACHE = readAhead(); | ||
292 | qWarning("searching for %d", uid ); | 292 | 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: | |||
67 | /** | 67 | /** |
68 | * queryByExample. | 68 | * queryByExample. |
69 | * @see otodoaccess, ocontactaccess | 69 | * @see otodoaccess, ocontactaccess |
@@ -118,2 +118,3 @@ public: | |||
118 | 118 | ||
119 | void setReadAhead( uint count ); | ||
119 | /** | 120 | /** |
@@ -253,2 +254,6 @@ void OPimAccessTemplate<T>::setSaneCacheSize( int size ) { | |||
253 | } | 254 | } |
255 | template <class T> | ||
256 | void OPimAccessTemplate<T>::setReadAhead( uint count ) { | ||
257 | m_backEnd->setReadAhead( count ); | ||
258 | } | ||
254 | #endif | 259 | #endif |