author | eilers <eilers> | 2003-03-21 10:33:09 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-03-21 10:33:09 (UTC) |
commit | 8136284c38384b169cd2843ee61480d45b6c1cba (patch) (unidiff) | |
tree | ad798e3df8dc27a41f431a2130dbf50947fbca49 /libopie/pim/otodoaccessxml.cpp | |
parent | 6f5f148ff9eac1e4d76bea4460a7984d1e3069b7 (diff) | |
download | opie-8136284c38384b169cd2843ee61480d45b6c1cba.zip opie-8136284c38384b169cd2843ee61480d45b6c1cba.tar.gz opie-8136284c38384b169cd2843ee61480d45b6c1cba.tar.bz2 |
Merged speed optimized xml backend for contacts to main.
Added QDateTime to querybyexample. For instance, it is now possible to get
all Birthdays/Anniversaries between two dates. This should be used
to show all birthdays in the datebook..
This change is sourcecode backward compatible but you have to upgrade
the binaries for today-addressbook.
Diffstat (limited to 'libopie/pim/otodoaccessxml.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/pim/otodoaccessxml.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie/pim/otodoaccessxml.cpp b/libopie/pim/otodoaccessxml.cpp index cda300b..71e8787 100644 --- a/libopie/pim/otodoaccessxml.cpp +++ b/libopie/pim/otodoaccessxml.cpp | |||
@@ -234,49 +234,49 @@ bool OTodoAccessXML::save() { | |||
234 | return false; | 234 | return false; |
235 | } | 235 | } |
236 | /* flush before renaming */ | 236 | /* flush before renaming */ |
237 | f.close(); | 237 | f.close(); |
238 | 238 | ||
239 | if( ::rename( strNewFile.latin1(), m_file.latin1() ) < 0 ) { | 239 | if( ::rename( strNewFile.latin1(), m_file.latin1() ) < 0 ) { |
240 | // qWarning("error renaming"); | 240 | // qWarning("error renaming"); |
241 | QFile::remove( strNewFile ); | 241 | QFile::remove( strNewFile ); |
242 | } | 242 | } |
243 | 243 | ||
244 | m_changed = false; | 244 | m_changed = false; |
245 | return true; | 245 | return true; |
246 | } | 246 | } |
247 | QArray<int> OTodoAccessXML::allRecords()const { | 247 | QArray<int> OTodoAccessXML::allRecords()const { |
248 | QArray<int> ids( m_events.count() ); | 248 | QArray<int> ids( m_events.count() ); |
249 | QMap<int, OTodo>::ConstIterator it; | 249 | QMap<int, OTodo>::ConstIterator it; |
250 | int i = 0; | 250 | int i = 0; |
251 | 251 | ||
252 | for ( it = m_events.begin(); it != m_events.end(); ++it ) { | 252 | for ( it = m_events.begin(); it != m_events.end(); ++it ) { |
253 | ids[i] = it.key(); | 253 | ids[i] = it.key(); |
254 | i++; | 254 | i++; |
255 | } | 255 | } |
256 | return ids; | 256 | return ids; |
257 | } | 257 | } |
258 | QArray<int> OTodoAccessXML::queryByExample( const OTodo&, int ) { | 258 | QArray<int> OTodoAccessXML::queryByExample( const OTodo&, int, const QDateTime& ) { |
259 | QArray<int> ids(0); | 259 | QArray<int> ids(0); |
260 | return ids; | 260 | return ids; |
261 | } | 261 | } |
262 | OTodo OTodoAccessXML::find( int uid )const { | 262 | OTodo OTodoAccessXML::find( int uid )const { |
263 | OTodo todo; | 263 | OTodo todo; |
264 | todo.setUid( 0 ); // isEmpty() | 264 | todo.setUid( 0 ); // isEmpty() |
265 | QMap<int, OTodo>::ConstIterator it = m_events.find( uid ); | 265 | QMap<int, OTodo>::ConstIterator it = m_events.find( uid ); |
266 | if ( it != m_events.end() ) | 266 | if ( it != m_events.end() ) |
267 | todo = it.data(); | 267 | todo = it.data(); |
268 | 268 | ||
269 | return todo; | 269 | return todo; |
270 | } | 270 | } |
271 | void OTodoAccessXML::clear() { | 271 | void OTodoAccessXML::clear() { |
272 | if (m_opened ) | 272 | if (m_opened ) |
273 | m_changed = true; | 273 | m_changed = true; |
274 | 274 | ||
275 | m_events.clear(); | 275 | m_events.clear(); |
276 | } | 276 | } |
277 | bool OTodoAccessXML::add( const OTodo& todo ) { | 277 | bool OTodoAccessXML::add( const OTodo& todo ) { |
278 | // qWarning("add"); | 278 | // qWarning("add"); |
279 | m_changed = true; | 279 | m_changed = true; |
280 | m_events.insert( todo.uid(), todo ); | 280 | m_events.insert( todo.uid(), todo ); |
281 | 281 | ||
282 | return true; | 282 | return true; |