summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimaccesstemplate.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/opimaccesstemplate.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimaccesstemplate.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h
index 7ab1ea5..f936d4e 100644
--- a/libopie2/opiepim/core/opimaccesstemplate.h
+++ b/libopie2/opiepim/core/opimaccesstemplate.h
@@ -169,25 +169,24 @@ public:
169 169
170 /** 170 /**
171 * replace T from backend 171 * replace T from backend
172 * @param t The item to replace 172 * @param t The item to replace
173 * @return <i>true</i> if successful. 173 * @return <i>true</i> if successful.
174 */ 174 */
175 virtual bool replace( const T& t) ; 175 virtual bool replace( const T& t) ;
176 176
177 void setReadAhead( uint count ); 177 void setReadAhead( uint count );
178 /** 178 /**
179 * @internal 179 * @internal
180 */ 180 */
181 virtual T cacheFind( int uid )const;
182 void cache( const T& )const; 181 void cache( const T& )const;
183 void setSaneCacheSize( int ); 182 void setSaneCacheSize( int );
184 183
185 QArray<int> records()const; 184 QArray<int> records()const;
186protected: 185protected:
187 /** 186 /**
188 * invalidate the cache 187 * invalidate the cache
189 */ 188 */
190 void invalidateCache(); 189 void invalidateCache();
191 190
192 void setBackEnd( BackEnd* end ); 191 void setBackEnd( BackEnd* end );
193 /** 192 /**
@@ -257,30 +256,24 @@ template <class T>
257T OPimAccessTemplate<T>::find( int uid ) const{ 256T OPimAccessTemplate<T>::find( int uid ) const{
258 // First search in cache.. 257 // First search in cache..
259 if ( m_cache.contains( uid ) ) 258 if ( m_cache.contains( uid ) )
260 return m_cache.find( uid ); 259 return m_cache.find( uid );
261 260
262 T t = m_backEnd->find( uid ); 261 T t = m_backEnd->find( uid );
263 cache( t ); 262 cache( t );
264 263
265 return t; 264 return t;
266} 265}
267 266
268template <class T> 267template <class T>
269T OPimAccessTemplate<T>::cacheFind( int uid ) const
270{
271 return m_cache.find( uid );
272}
273
274template <class T>
275T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar, 268T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar,
276 uint current, typename OTemplateBase<T>::CacheDirection dir )const { 269 uint current, typename OTemplateBase<T>::CacheDirection dir )const {
277 /* 270 /*
278 * better do T.isEmpty() 271 * better do T.isEmpty()
279 * after a find this way we would 272 * after a find this way we would
280 * avoid two finds in QCache... 273 * avoid two finds in QCache...
281 */ 274 */
282 // owarn << "find it now " << uid << oendl; 275 // owarn << "find it now " << uid << oendl;
283 if ( m_cache.contains( uid ) ) { 276 if ( m_cache.contains( uid ) ) {
284 return m_cache.find( uid ); 277 return m_cache.find( uid );
285 } 278 }
286 279