author | zecke <zecke> | 2002-10-13 02:22:58 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-13 02:22:58 (UTC) |
commit | d96ce086c617b5b2efc5081cd10a43257a78f488 (patch) (unidiff) | |
tree | 4f6b80b7295127bd82cc5fb8ffd1d532c42a396b /libopie2/opiepim/core | |
parent | 2ce86d9be1bbf99092348adf815578b110fe7289 (diff) | |
download | opie-d96ce086c617b5b2efc5081cd10a43257a78f488.zip opie-d96ce086c617b5b2efc5081cd10a43257a78f488.tar.gz opie-d96ce086c617b5b2efc5081cd10a43257a78f488.tar.bz2 |
OPimAccessBackend nothing tried a isDirty()const ... but removed it
ORecordList uidAt(uint index ) added
Speed Improvements at the SQL backend
do not load the list of uids until it's really needed
do not reload the uid list until it's really needed
we got a bitfield m_dirty there...
-rw-r--r-- | libopie2/opiepim/core/opimaccesstemplate.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h index 92d7192..a0d8f63 100644 --- a/libopie2/opiepim/core/opimaccesstemplate.h +++ b/libopie2/opiepim/core/opimaccesstemplate.h | |||
@@ -163,54 +163,52 @@ OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const { | |||
163 | template <class T> | 163 | template <class T> |
164 | OPimAccessTemplate<T>::List | 164 | OPimAccessTemplate<T>::List |
165 | OPimAccessTemplate<T>::queryByExample( const T& t, int sortOrder ) { | 165 | OPimAccessTemplate<T>::queryByExample( const T& t, int sortOrder ) { |
166 | QArray<int> ints = m_backEnd->queryByExample( t, sortOrder ); | 166 | QArray<int> ints = m_backEnd->queryByExample( t, sortOrder ); |
167 | 167 | ||
168 | List lis(ints, this ); | 168 | List lis(ints, this ); |
169 | return lis; | 169 | return lis; |
170 | } | 170 | } |
171 | template <class T> | 171 | template <class T> |
172 | T OPimAccessTemplate<T>::find( int uid ) const{ | 172 | T OPimAccessTemplate<T>::find( int uid ) const{ |
173 | T t = m_backEnd->find( uid ); | 173 | T t = m_backEnd->find( uid ); |
174 | cache( t ); | 174 | cache( t ); |
175 | return t; | 175 | return t; |
176 | } | 176 | } |
177 | template <class T> | 177 | template <class T> |
178 | T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar, | 178 | T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar, |
179 | uint current, CacheDirection dir )const { | 179 | uint current, CacheDirection dir )const { |
180 | /* | 180 | /* |
181 | * better do T.isEmpty() | 181 | * better do T.isEmpty() |
182 | * after a find this way we would | 182 | * after a find this way we would |
183 | * avoid two finds in QCache... | 183 | * avoid two finds in QCache... |
184 | */ | 184 | */ |
185 | // qWarning("find it now %d", uid ); | 185 | // qWarning("find it now %d", uid ); |
186 | if (m_cache.contains( uid ) ) { | 186 | if (m_cache.contains( uid ) ) { |
187 | qWarning("m cache contains %d", uid); | ||
188 | return m_cache.find( uid ); | 187 | return m_cache.find( uid ); |
189 | } | 188 | } |
190 | 189 | ||
191 | T t = m_backEnd->find( uid, ar, current, dir ); | 190 | T t = m_backEnd->find( uid, ar, current, dir ); |
192 | qWarning("found it and cache it now %d", uid); | ||
193 | cache( t ); | 191 | cache( t ); |
194 | return t; | 192 | return t; |
195 | } | 193 | } |
196 | template <class T> | 194 | template <class T> |
197 | void OPimAccessTemplate<T>::clear() { | 195 | void OPimAccessTemplate<T>::clear() { |
198 | invalidateCache(); | 196 | invalidateCache(); |
199 | m_backEnd->clear(); | 197 | m_backEnd->clear(); |
200 | } | 198 | } |
201 | template <class T> | 199 | template <class T> |
202 | bool OPimAccessTemplate<T>::add( const T& t ) { | 200 | bool OPimAccessTemplate<T>::add( const T& t ) { |
203 | cache( t ); | 201 | cache( t ); |
204 | return m_backEnd->add( t ); | 202 | return m_backEnd->add( t ); |
205 | } | 203 | } |
206 | template <class T> | 204 | template <class T> |
207 | bool OPimAccessTemplate<T>::remove( const T& t ) { | 205 | bool OPimAccessTemplate<T>::remove( const T& t ) { |
208 | return remove( t.uid() ); | 206 | return remove( t.uid() ); |
209 | } | 207 | } |
210 | template <class T> | 208 | template <class T> |
211 | bool OPimAccessTemplate<T>::remove( int uid ) { | 209 | bool OPimAccessTemplate<T>::remove( int uid ) { |
212 | m_cache.remove( uid ); | 210 | m_cache.remove( uid ); |
213 | return m_backEnd->remove( uid ); | 211 | return m_backEnd->remove( uid ); |
214 | } | 212 | } |
215 | template <class T> | 213 | template <class T> |
216 | bool OPimAccessTemplate<T>::replace( const T& t ) { | 214 | bool OPimAccessTemplate<T>::replace( const T& t ) { |