summaryrefslogtreecommitdiff
path: root/libopie/pim/opimaccesstemplate.h
Unidiff
Diffstat (limited to 'libopie/pim/opimaccesstemplate.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie/pim/opimaccesstemplate.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libopie/pim/opimaccesstemplate.h b/libopie/pim/opimaccesstemplate.h
index 259e2c1..6a3a0db 100644
--- a/libopie/pim/opimaccesstemplate.h
+++ b/libopie/pim/opimaccesstemplate.h
@@ -53,49 +53,49 @@ public:
53 53
54 /** Save contacts database. 54 /** Save contacts database.
55 * Save is more a "commit". After calling this function, all changes are public available. 55 * Save is more a "commit". After calling this function, all changes are public available.
56 * @return true if successful 56 * @return true if successful
57 */ 57 */
58 bool save(); 58 bool save();
59 59
60 /** 60 /**
61 * if the resource was changed externally 61 * if the resource was changed externally
62 * You should use the signal handling instead of polling possible changes ! 62 * You should use the signal handling instead of polling possible changes !
63 * zecke: Do you implement a signal for otodoaccess ? 63 * zecke: Do you implement a signal for otodoaccess ?
64 */ 64 */
65 bool wasChangedExternally()const; 65 bool wasChangedExternally()const;
66 66
67 /** 67 /**
68 * return a List of records 68 * return a List of records
69 * you can iterate over them 69 * you can iterate over them
70 */ 70 */
71 virtual List allRecords()const; 71 virtual List allRecords()const;
72 72
73 /** 73 /**
74 * queryByExample. 74 * queryByExample.
75 * @see otodoaccess, ocontactaccess 75 * @see otodoaccess, ocontactaccess
76 */ 76 */
77 virtual List queryByExample( const T& t, int querySettings ); 77 virtual List queryByExample( const T& t, int querySettings, const QDateTime& d = QDateTime() );
78 78
79 /** 79 /**
80 * find the OPimRecord uid 80 * find the OPimRecord uid
81 */ 81 */
82 virtual T find( int uid )const; 82 virtual T find( int uid )const;
83 83
84 /** 84 /**
85 * read ahead cache find method ;) 85 * read ahead cache find method ;)
86 */ 86 */
87 virtual T find( int uid, const QArray<int>&, 87 virtual T find( int uid, const QArray<int>&,
88 uint current, typename OTemplateBase<T>::CacheDirection dir = OTemplateBase<T>::Forward )const; 88 uint current, typename OTemplateBase<T>::CacheDirection dir = OTemplateBase<T>::Forward )const;
89 89
90 /* invalidate cache here */ 90 /* invalidate cache here */
91 /** 91 /**
92 * clears the backend and invalidates the backend 92 * clears the backend and invalidates the backend
93 */ 93 */
94 void clear() ; 94 void clear() ;
95 95
96 /** 96 /**
97 * add T to the backend 97 * add T to the backend
98 * @param t The item to add. 98 * @param t The item to add.
99 * @return <i>true</i> if added successfully. 99 * @return <i>true</i> if added successfully.
100 */ 100 */
101 virtual bool add( const T& t ) ; 101 virtual bool add( const T& t ) ;
@@ -165,50 +165,50 @@ bool OPimAccessTemplate<T>::load() {
165 invalidateCache(); 165 invalidateCache();
166 return m_backEnd->load(); 166 return m_backEnd->load();
167} 167}
168template <class T> 168template <class T>
169bool OPimAccessTemplate<T>::reload() { 169bool OPimAccessTemplate<T>::reload() {
170 invalidateCache(); // zecke: I think this should be added (se) 170 invalidateCache(); // zecke: I think this should be added (se)
171 return m_backEnd->reload(); 171 return m_backEnd->reload();
172} 172}
173template <class T> 173template <class T>
174bool OPimAccessTemplate<T>::save() { 174bool OPimAccessTemplate<T>::save() {
175 return m_backEnd->save(); 175 return m_backEnd->save();
176} 176}
177template <class T> 177template <class T>
178typename OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const { 178typename OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const {
179 QArray<int> ints = m_backEnd->allRecords(); 179 QArray<int> ints = m_backEnd->allRecords();
180 List lis(ints, this ); 180 List lis(ints, this );
181 return lis; 181 return lis;
182} 182}
183template <class T> 183template <class T>
184QArray<int> OPimAccessTemplate<T>::records()const { 184QArray<int> OPimAccessTemplate<T>::records()const {
185 return m_backEnd->allRecords(); 185 return m_backEnd->allRecords();
186} 186}
187template <class T> 187template <class T>
188typename OPimAccessTemplate<T>::List 188typename OPimAccessTemplate<T>::List
189OPimAccessTemplate<T>::queryByExample( const T& t, int sortOrder ) { 189OPimAccessTemplate<T>::queryByExample( const T& t, int settings, const QDateTime& d ) {
190 QArray<int> ints = m_backEnd->queryByExample( t, sortOrder ); 190 QArray<int> ints = m_backEnd->queryByExample( t, settings, d );
191 191
192 List lis(ints, this ); 192 List lis(ints, this );
193 return lis; 193 return lis;
194} 194}
195template <class T> 195template <class T>
196T OPimAccessTemplate<T>::find( int uid ) const{ 196T OPimAccessTemplate<T>::find( int uid ) const{
197 T t = m_backEnd->find( uid ); 197 T t = m_backEnd->find( uid );
198 cache( t ); 198 cache( t );
199 return t; 199 return t;
200} 200}
201template <class T> 201template <class T>
202T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar, 202T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar,
203 uint current, typename OTemplateBase<T>::CacheDirection dir )const { 203 uint current, typename OTemplateBase<T>::CacheDirection dir )const {
204 /* 204 /*
205 * better do T.isEmpty() 205 * better do T.isEmpty()
206 * after a find this way we would 206 * after a find this way we would
207 * avoid two finds in QCache... 207 * avoid two finds in QCache...
208 */ 208 */
209 // qWarning("find it now %d", uid ); 209 // qWarning("find it now %d", uid );
210 if (m_cache.contains( uid ) ) { 210 if (m_cache.contains( uid ) ) {
211 return m_cache.find( uid ); 211 return m_cache.find( uid );
212 } 212 }
213 213
214 T t = m_backEnd->find( uid, ar, current, dir ); 214 T t = m_backEnd->find( uid, ar, current, dir );