Diffstat (limited to 'libopie2/opiepim/backend/otodoaccessxml.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessxml.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp index 71e8787..55f268b 100644 --- a/libopie2/opiepim/backend/otodoaccessxml.cpp +++ b/libopie2/opiepim/backend/otodoaccessxml.cpp | |||
@@ -619,57 +619,71 @@ QArray<int> OTodoAccessXML::sorted( bool asc, int sortOrder, | |||
619 | int sortFilter, int cat ) { | 619 | int sortFilter, int cat ) { |
620 | qWarning("sorted! %d cat", cat); | 620 | qWarning("sorted! %d cat", cat); |
621 | OTodoXMLVector vector(m_events.count(), asc,sortOrder ); | 621 | OTodoXMLVector vector(m_events.count(), asc,sortOrder ); |
622 | QMap<int, OTodo>::Iterator it; | 622 | QMap<int, OTodo>::Iterator it; |
623 | int item = 0; | 623 | int item = 0; |
624 | 624 | ||
625 | bool bCat = sortFilter & 1 ? true : false; | 625 | bool bCat = sortFilter & 1 ? true : false; |
626 | bool bOnly = sortFilter & 2 ? true : false; | 626 | bool bOnly = sortFilter & 2 ? true : false; |
627 | bool comp = sortFilter & 4 ? true : false; | 627 | bool comp = sortFilter & 4 ? true : false; |
628 | for ( it = m_events.begin(); it != m_events.end(); ++it ) { | 628 | for ( it = m_events.begin(); it != m_events.end(); ++it ) { |
629 | 629 | ||
630 | /* show category */ | 630 | /* show category */ |
631 | if ( bCat && cat != 0) | 631 | if ( bCat && cat != 0) |
632 | if (!(*it).categories().contains( cat ) ) { | 632 | if (!(*it).categories().contains( cat ) ) { |
633 | qWarning("category mis match"); | 633 | qWarning("category mis match"); |
634 | continue; | 634 | continue; |
635 | } | 635 | } |
636 | /* isOverdue but we should not show overdue - why?*/ | 636 | /* isOverdue but we should not show overdue - why?*/ |
637 | /* if ( (*it).isOverdue() && !bOnly ) { | 637 | /* if ( (*it).isOverdue() && !bOnly ) { |
638 | qWarning("item is overdue but !bOnly"); | 638 | qWarning("item is overdue but !bOnly"); |
639 | continue; | 639 | continue; |
640 | } | 640 | } |
641 | */ | 641 | */ |
642 | if ( !(*it).isOverdue() && bOnly ) { | 642 | if ( !(*it).isOverdue() && bOnly ) { |
643 | qWarning("item is not overdue but bOnly checked"); | 643 | qWarning("item is not overdue but bOnly checked"); |
644 | continue; | 644 | continue; |
645 | } | 645 | } |
646 | 646 | ||
647 | if ((*it).isCompleted() && comp ) { | 647 | if ((*it).isCompleted() && comp ) { |
648 | qWarning("completed continue!"); | 648 | qWarning("completed continue!"); |
649 | continue; | 649 | continue; |
650 | } | 650 | } |
651 | 651 | ||
652 | 652 | ||
653 | OTodoXMLContainer* con = new OTodoXMLContainer(); | 653 | OTodoXMLContainer* con = new OTodoXMLContainer(); |
654 | con->todo = (*it); | 654 | con->todo = (*it); |
655 | vector.insert(item, con ); | 655 | vector.insert(item, con ); |
656 | item++; | 656 | item++; |
657 | } | 657 | } |
658 | qWarning("XXX %d Items added", item); | 658 | qWarning("XXX %d Items added", item); |
659 | vector.resize( item ); | 659 | vector.resize( item ); |
660 | /* sort it now */ | 660 | /* sort it now */ |
661 | vector.sort(); | 661 | vector.sort(); |
662 | /* now get the uids */ | 662 | /* now get the uids */ |
663 | QArray<int> array( vector.count() ); | 663 | QArray<int> array( vector.count() ); |
664 | for (uint i= 0; i < vector.count(); i++ ) { | 664 | for (uint i= 0; i < vector.count(); i++ ) { |
665 | array[i] = ( vector.at(i) )->todo.uid(); | 665 | array[i] = ( vector.at(i) )->todo.uid(); |
666 | } | 666 | } |
667 | qWarning("array count = %d %d", array.count(), vector.count() ); | ||
668 | return array; | 667 | return array; |
669 | }; | 668 | }; |
670 | void OTodoAccessXML::removeAllCompleted() { | 669 | void OTodoAccessXML::removeAllCompleted() { |
671 | for ( QMap<int, OTodo>::Iterator it = m_events.begin(); it != m_events.end(); ++it ) { | 670 | for ( QMap<int, OTodo>::Iterator it = m_events.begin(); it != m_events.end(); ++it ) { |
672 | if ( (*it).isCompleted() ) | 671 | if ( (*it).isCompleted() ) |
673 | m_events.remove( it ); | 672 | m_events.remove( it ); |
674 | } | 673 | } |
675 | } | 674 | } |
675 | QBitArray OTodoAccessXML::supports()const { | ||
676 | static QBitArray ar = sup(); | ||
677 | return ar; | ||
678 | } | ||
679 | QBitArray OTodoAccessXML::sup() { | ||
680 | QBitArray ar( OTodo::CompletedDate +1 ); | ||
681 | ar.fill( true ); | ||
682 | ar[OTodo::CrossReference] = false; | ||
683 | ar[OTodo::State ] = false; | ||
684 | ar[OTodo::Reminders] = false; | ||
685 | ar[OTodo::Notifiers] = false; | ||
686 | ar[OTodo::Maintainer] = false; | ||
687 | |||
688 | return ar; | ||
689 | } | ||