Diffstat (limited to 'libopie2/opiepim/backend/otodoaccesssql.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/otodoaccesssql.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libopie2/opiepim/backend/otodoaccesssql.cpp b/libopie2/opiepim/backend/otodoaccesssql.cpp index ea8b3c9..9ef6b7c 100644 --- a/libopie2/opiepim/backend/otodoaccesssql.cpp +++ b/libopie2/opiepim/backend/otodoaccesssql.cpp @@ -281,36 +281,37 @@ QArray<int> OTodoAccessBackendSQL::queryByExample( const OTodo& , int ){ QArray<int> ints(0); return ints; } OTodo OTodoAccessBackendSQL::find(int uid ) const{ FindQuery query( uid ); return todo( m_driver->query(&query) ); } +#define CACHE 32 OTodo OTodoAccessBackendSQL::find( int uid, const QArray<int>& ints, uint cur, Frontend::CacheDirection dir ) const{ qWarning("searching for %d", uid ); - QArray<int> search( 8 ); + QArray<int> search( CACHE ); uint size =0; OTodo to; - // we try to cache 8 items + // we try to cache CACHE items switch( dir ) { /* forward */ case 0: - for (uint i = cur; i < ints.count() && size < 8; i++ ) { + for (uint i = cur; i < ints.count() && size < CACHE; i++ ) { qWarning("size %d %d", size, ints[i] ); search[size] = ints[i]; size++; } break; /* reverse */ case 1: - for (uint i = cur; i != 0 && size < 8; i-- ) { + for (uint i = cur; i != 0 && size < CACHE; i-- ) { search[size] = ints[i]; size++; } break; } search.resize( size ); FindQuery query( search ); OSQLResult res = m_driver->query( &query ); |