summaryrefslogtreecommitdiff
authorzecke <zecke>2004-07-17 17:33:39 (UTC)
committer zecke <zecke>2004-07-17 17:33:39 (UTC)
commitb822cb8e0f2b1adc970eee9e40935adaf530e41b (patch) (unidiff)
treef42fe5d6144df85b35a7e1c8d008f28ca2532b1f
parent0637a8d3c60bf4da6efb6c26edecfe613919c623 (diff)
downloadopie-b822cb8e0f2b1adc970eee9e40935adaf530e41b.zip
opie-b822cb8e0f2b1adc970eee9e40935adaf530e41b.tar.gz
opie-b822cb8e0f2b1adc970eee9e40935adaf530e41b.tar.bz2
Allow the deletions of all events
This is the fix posted to the MailingList
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
index 2ff36e3..107c178 100644
--- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
+++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
@@ -263,97 +263,97 @@ bool ODateBookAccessBackend_XML::save() {
263 QFile::remove( strFileNew ); 263 QFile::remove( strFileNew );
264 return false; 264 return false;
265 } 265 }
266 266
267 m_changed = false; 267 m_changed = false;
268 return true; 268 return true;
269} 269}
270QArray<int> ODateBookAccessBackend_XML::allRecords()const { 270QArray<int> ODateBookAccessBackend_XML::allRecords()const {
271 QArray<int> ints( m_raw.count()+ m_rep.count() ); 271 QArray<int> ints( m_raw.count()+ m_rep.count() );
272 uint i = 0; 272 uint i = 0;
273 QMap<int, OPimEvent>::ConstIterator it; 273 QMap<int, OPimEvent>::ConstIterator it;
274 274
275 for ( it = m_raw.begin(); it != m_raw.end(); ++it ) { 275 for ( it = m_raw.begin(); it != m_raw.end(); ++it ) {
276 ints[i] = it.key(); 276 ints[i] = it.key();
277 i++; 277 i++;
278 } 278 }
279 for ( it = m_rep.begin(); it != m_rep.end(); ++it ) { 279 for ( it = m_rep.begin(); it != m_rep.end(); ++it ) {
280 ints[i] = it.key(); 280 ints[i] = it.key();
281 i++; 281 i++;
282 } 282 }
283 283
284 return ints; 284 return ints;
285} 285}
286QArray<int> ODateBookAccessBackend_XML::queryByExample(const OPimEvent&, int, const QDateTime& ) { 286QArray<int> ODateBookAccessBackend_XML::queryByExample(const OPimEvent&, int, const QDateTime& ) {
287 return QArray<int>(); 287 return QArray<int>();
288} 288}
289void ODateBookAccessBackend_XML::clear() { 289void ODateBookAccessBackend_XML::clear() {
290 m_changed = true; 290 m_changed = true;
291 m_raw.clear(); 291 m_raw.clear();
292 m_rep.clear(); 292 m_rep.clear();
293} 293}
294OPimEvent ODateBookAccessBackend_XML::find( int uid ) const{ 294OPimEvent ODateBookAccessBackend_XML::find( int uid ) const{
295 if ( m_raw.contains( uid ) ) 295 if ( m_raw.contains( uid ) )
296 return m_raw[uid]; 296 return m_raw[uid];
297 else 297 else
298 return m_rep[uid]; 298 return m_rep[uid];
299} 299}
300bool ODateBookAccessBackend_XML::add( const OPimEvent& ev ) { 300bool ODateBookAccessBackend_XML::add( const OPimEvent& ev ) {
301 m_changed = true; 301 m_changed = true;
302 if (ev.hasRecurrence() ) 302 if (ev.hasRecurrence() )
303 m_rep.insert( ev.uid(), ev ); 303 m_rep.insert( ev.uid(), ev );
304 else 304 else
305 m_raw.insert( ev.uid(), ev ); 305 m_raw.insert( ev.uid(), ev );
306 306
307 return true; 307 return true;
308} 308}
309bool ODateBookAccessBackend_XML::remove( int uid ) { 309bool ODateBookAccessBackend_XML::remove( int uid ) {
310 m_changed = true; 310 m_changed = true;
311 m_rep.remove( uid ); 311 m_raw.remove( uid );
312 m_rep.remove( uid ); 312 m_rep.remove( uid );
313 313
314 return true; 314 return true;
315} 315}
316bool ODateBookAccessBackend_XML::replace( const OPimEvent& ev ) { 316bool ODateBookAccessBackend_XML::replace( const OPimEvent& ev ) {
317 replace( ev.uid() ); // ??? Shouldn't this be "remove( ev.uid() ) ??? (eilers) 317 replace( ev.uid() ); // ??? Shouldn't this be "remove( ev.uid() ) ??? (eilers)
318 return add( ev ); 318 return add( ev );
319} 319}
320QArray<int> ODateBookAccessBackend_XML::rawEvents()const { 320QArray<int> ODateBookAccessBackend_XML::rawEvents()const {
321 return allRecords(); 321 return allRecords();
322} 322}
323QArray<int> ODateBookAccessBackend_XML::rawRepeats()const { 323QArray<int> ODateBookAccessBackend_XML::rawRepeats()const {
324 QArray<int> ints( m_rep.count() ); 324 QArray<int> ints( m_rep.count() );
325 uint i = 0; 325 uint i = 0;
326 QMap<int, OPimEvent>::ConstIterator it; 326 QMap<int, OPimEvent>::ConstIterator it;
327 327
328 for ( it = m_rep.begin(); it != m_rep.end(); ++it ) { 328 for ( it = m_rep.begin(); it != m_rep.end(); ++it ) {
329 ints[i] = it.key(); 329 ints[i] = it.key();
330 i++; 330 i++;
331 } 331 }
332 332
333 return ints; 333 return ints;
334} 334}
335QArray<int> ODateBookAccessBackend_XML::nonRepeats()const { 335QArray<int> ODateBookAccessBackend_XML::nonRepeats()const {
336 QArray<int> ints( m_raw.count() ); 336 QArray<int> ints( m_raw.count() );
337 uint i = 0; 337 uint i = 0;
338 QMap<int, OPimEvent>::ConstIterator it; 338 QMap<int, OPimEvent>::ConstIterator it;
339 339
340 for ( it = m_raw.begin(); it != m_raw.end(); ++it ) { 340 for ( it = m_raw.begin(); it != m_raw.end(); ++it ) {
341 ints[i] = it.key(); 341 ints[i] = it.key();
342 i++; 342 i++;
343 } 343 }
344 344
345 return ints; 345 return ints;
346} 346}
347OPimEvent::ValueList ODateBookAccessBackend_XML::directNonRepeats() { 347OPimEvent::ValueList ODateBookAccessBackend_XML::directNonRepeats() {
348 OPimEvent::ValueList list; 348 OPimEvent::ValueList list;
349 QMap<int, OPimEvent>::ConstIterator it; 349 QMap<int, OPimEvent>::ConstIterator it;
350 for (it = m_raw.begin(); it != m_raw.end(); ++it ) 350 for (it = m_raw.begin(); it != m_raw.end(); ++it )
351 list.append( it.data() ); 351 list.append( it.data() );
352 352
353 return list; 353 return list;
354} 354}
355OPimEvent::ValueList ODateBookAccessBackend_XML::directRawRepeats() { 355OPimEvent::ValueList ODateBookAccessBackend_XML::directRawRepeats() {
356 OPimEvent::ValueList list; 356 OPimEvent::ValueList list;
357 QMap<int, OPimEvent>::ConstIterator it; 357 QMap<int, OPimEvent>::ConstIterator it;
358 for (it = m_rep.begin(); it != m_rep.end(); ++it ) 358 for (it = m_rep.begin(); it != m_rep.end(); ++it )
359 list.append( it.data() ); 359 list.append( it.data() );