-rw-r--r-- | libopie/pim/orecordlist.h | 2 | ||||
-rw-r--r-- | libopie2/opiepim/orecordlist.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/libopie/pim/orecordlist.h b/libopie/pim/orecordlist.h index b77a4ab..edcd729 100644 --- a/libopie/pim/orecordlist.h +++ b/libopie/pim/orecordlist.h | |||
@@ -244,49 +244,49 @@ ORecordList<T>::ORecordList( const QArray<int>& ids, | |||
244 | } | 244 | } |
245 | template <class T> | 245 | template <class T> |
246 | ORecordList<T>::~ORecordList() { | 246 | ORecordList<T>::~ORecordList() { |
247 | /* nothing to do here */ | 247 | /* nothing to do here */ |
248 | } | 248 | } |
249 | template <class T> | 249 | template <class T> |
250 | typename ORecordList<T>::Iterator ORecordList<T>::begin() { | 250 | typename ORecordList<T>::Iterator ORecordList<T>::begin() { |
251 | Iterator it( m_ids, m_acc ); | 251 | Iterator it( m_ids, m_acc ); |
252 | return it; | 252 | return it; |
253 | } | 253 | } |
254 | template <class T> | 254 | template <class T> |
255 | typename ORecordList<T>::Iterator ORecordList<T>::end() { | 255 | typename ORecordList<T>::Iterator ORecordList<T>::end() { |
256 | Iterator it( m_ids, m_acc ); | 256 | Iterator it( m_ids, m_acc ); |
257 | it.m_end = true; | 257 | it.m_end = true; |
258 | it.m_current = m_ids.count(); | 258 | it.m_current = m_ids.count(); |
259 | 259 | ||
260 | return it; | 260 | return it; |
261 | } | 261 | } |
262 | template <class T> | 262 | template <class T> |
263 | uint ORecordList<T>::count()const { | 263 | uint ORecordList<T>::count()const { |
264 | return m_ids.count(); | 264 | return m_ids.count(); |
265 | } | 265 | } |
266 | template <class T> | 266 | template <class T> |
267 | T ORecordList<T>::operator[]( uint i ) { | 267 | T ORecordList<T>::operator[]( uint i ) { |
268 | if ( i < 0 || (i+1) > m_ids.count() ) | 268 | if ( i >= m_ids.count() ) |
269 | return T(); | 269 | return T(); |
270 | /* forward */ | 270 | /* forward */ |
271 | return m_acc->find( m_ids[i], m_ids, i ); | 271 | return m_acc->find( m_ids[i], m_ids, i ); |
272 | } | 272 | } |
273 | template <class T> | 273 | template <class T> |
274 | int ORecordList<T>::uidAt( uint i ) { | 274 | int ORecordList<T>::uidAt( uint i ) { |
275 | return m_ids[i]; | 275 | return m_ids[i]; |
276 | } | 276 | } |
277 | 277 | ||
278 | template <class T> | 278 | template <class T> |
279 | bool ORecordList<T>::remove( int uid ) { | 279 | bool ORecordList<T>::remove( int uid ) { |
280 | QArray<int> copy( m_ids.count() ); | 280 | QArray<int> copy( m_ids.count() ); |
281 | int counter = 0; | 281 | int counter = 0; |
282 | bool ret_val = false; | 282 | bool ret_val = false; |
283 | 283 | ||
284 | for (uint i = 0; i < m_ids.count(); i++){ | 284 | for (uint i = 0; i < m_ids.count(); i++){ |
285 | if ( m_ids[i] != uid ){ | 285 | if ( m_ids[i] != uid ){ |
286 | copy[counter++] = m_ids[i]; | 286 | copy[counter++] = m_ids[i]; |
287 | 287 | ||
288 | }else | 288 | }else |
289 | ret_val = true; | 289 | ret_val = true; |
290 | } | 290 | } |
291 | 291 | ||
292 | copy.resize( counter ); | 292 | copy.resize( counter ); |
diff --git a/libopie2/opiepim/orecordlist.h b/libopie2/opiepim/orecordlist.h index b77a4ab..edcd729 100644 --- a/libopie2/opiepim/orecordlist.h +++ b/libopie2/opiepim/orecordlist.h | |||
@@ -244,49 +244,49 @@ ORecordList<T>::ORecordList( const QArray<int>& ids, | |||
244 | } | 244 | } |
245 | template <class T> | 245 | template <class T> |
246 | ORecordList<T>::~ORecordList() { | 246 | ORecordList<T>::~ORecordList() { |
247 | /* nothing to do here */ | 247 | /* nothing to do here */ |
248 | } | 248 | } |
249 | template <class T> | 249 | template <class T> |
250 | typename ORecordList<T>::Iterator ORecordList<T>::begin() { | 250 | typename ORecordList<T>::Iterator ORecordList<T>::begin() { |
251 | Iterator it( m_ids, m_acc ); | 251 | Iterator it( m_ids, m_acc ); |
252 | return it; | 252 | return it; |
253 | } | 253 | } |
254 | template <class T> | 254 | template <class T> |
255 | typename ORecordList<T>::Iterator ORecordList<T>::end() { | 255 | typename ORecordList<T>::Iterator ORecordList<T>::end() { |
256 | Iterator it( m_ids, m_acc ); | 256 | Iterator it( m_ids, m_acc ); |
257 | it.m_end = true; | 257 | it.m_end = true; |
258 | it.m_current = m_ids.count(); | 258 | it.m_current = m_ids.count(); |
259 | 259 | ||
260 | return it; | 260 | return it; |
261 | } | 261 | } |
262 | template <class T> | 262 | template <class T> |
263 | uint ORecordList<T>::count()const { | 263 | uint ORecordList<T>::count()const { |
264 | return m_ids.count(); | 264 | return m_ids.count(); |
265 | } | 265 | } |
266 | template <class T> | 266 | template <class T> |
267 | T ORecordList<T>::operator[]( uint i ) { | 267 | T ORecordList<T>::operator[]( uint i ) { |
268 | if ( i < 0 || (i+1) > m_ids.count() ) | 268 | if ( i >= m_ids.count() ) |
269 | return T(); | 269 | return T(); |
270 | /* forward */ | 270 | /* forward */ |
271 | return m_acc->find( m_ids[i], m_ids, i ); | 271 | return m_acc->find( m_ids[i], m_ids, i ); |
272 | } | 272 | } |
273 | template <class T> | 273 | template <class T> |
274 | int ORecordList<T>::uidAt( uint i ) { | 274 | int ORecordList<T>::uidAt( uint i ) { |
275 | return m_ids[i]; | 275 | return m_ids[i]; |
276 | } | 276 | } |
277 | 277 | ||
278 | template <class T> | 278 | template <class T> |
279 | bool ORecordList<T>::remove( int uid ) { | 279 | bool ORecordList<T>::remove( int uid ) { |
280 | QArray<int> copy( m_ids.count() ); | 280 | QArray<int> copy( m_ids.count() ); |
281 | int counter = 0; | 281 | int counter = 0; |
282 | bool ret_val = false; | 282 | bool ret_val = false; |
283 | 283 | ||
284 | for (uint i = 0; i < m_ids.count(); i++){ | 284 | for (uint i = 0; i < m_ids.count(); i++){ |
285 | if ( m_ids[i] != uid ){ | 285 | if ( m_ids[i] != uid ){ |
286 | copy[counter++] = m_ids[i]; | 286 | copy[counter++] = m_ids[i]; |
287 | 287 | ||
288 | }else | 288 | }else |
289 | ret_val = true; | 289 | ret_val = true; |
290 | } | 290 | } |
291 | 291 | ||
292 | copy.resize( counter ); | 292 | copy.resize( counter ); |