summaryrefslogtreecommitdiff
path: root/libopie2/opiepim
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/opimaccessbackend.h16
-rw-r--r--libopie2/opiepim/backend/otodoaccesssql.cpp2
-rw-r--r--libopie2/opiepim/core/opimaccesstemplate.h7
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:
+ /**
+ * 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