Diffstat (limited to 'libopie/pim/otodoaccessxml.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/pim/otodoaccessxml.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libopie/pim/otodoaccessxml.cpp b/libopie/pim/otodoaccessxml.cpp index 285d2b8..69b7ab4 100644 --- a/libopie/pim/otodoaccessxml.cpp +++ b/libopie/pim/otodoaccessxml.cpp | |||
@@ -729,48 +729,64 @@ QArray<int> OTodoAccessXML::sorted( bool asc, int sortOrder, | |||
729 | if ( !(*it).isOverdue() && bOnly ) { | 729 | if ( !(*it).isOverdue() && bOnly ) { |
730 | qWarning("item is not overdue but bOnly checked"); | 730 | qWarning("item is not overdue but bOnly checked"); |
731 | continue; | 731 | continue; |
732 | } | 732 | } |
733 | 733 | ||
734 | if ((*it).isCompleted() && comp ) { | 734 | if ((*it).isCompleted() && comp ) { |
735 | qWarning("completed continue!"); | 735 | qWarning("completed continue!"); |
736 | continue; | 736 | continue; |
737 | } | 737 | } |
738 | 738 | ||
739 | 739 | ||
740 | OTodoXMLContainer* con = new OTodoXMLContainer(); | 740 | OTodoXMLContainer* con = new OTodoXMLContainer(); |
741 | con->todo = (*it); | 741 | con->todo = (*it); |
742 | vector.insert(item, con ); | 742 | vector.insert(item, con ); |
743 | item++; | 743 | item++; |
744 | } | 744 | } |
745 | qWarning("XXX %d Items added", item); | 745 | qWarning("XXX %d Items added", item); |
746 | vector.resize( item ); | 746 | vector.resize( item ); |
747 | /* sort it now */ | 747 | /* sort it now */ |
748 | vector.sort(); | 748 | vector.sort(); |
749 | /* now get the uids */ | 749 | /* now get the uids */ |
750 | QArray<int> array( vector.count() ); | 750 | QArray<int> array( vector.count() ); |
751 | for (uint i= 0; i < vector.count(); i++ ) { | 751 | for (uint i= 0; i < vector.count(); i++ ) { |
752 | array[i] = ( vector.at(i) )->todo.uid(); | 752 | array[i] = ( vector.at(i) )->todo.uid(); |
753 | } | 753 | } |
754 | return array; | 754 | return array; |
755 | }; | 755 | }; |
756 | void OTodoAccessXML::removeAllCompleted() { | 756 | void OTodoAccessXML::removeAllCompleted() { |
757 | for ( QMap<int, OTodo>::Iterator it = m_events.begin(); it != m_events.end(); ++it ) { | 757 | for ( QMap<int, OTodo>::Iterator it = m_events.begin(); it != m_events.end(); ++it ) { |
758 | if ( (*it).isCompleted() ) | 758 | if ( (*it).isCompleted() ) |
759 | m_events.remove( it ); | 759 | m_events.remove( it ); |
760 | } | 760 | } |
761 | } | 761 | } |
762 | QBitArray OTodoAccessXML::supports()const { | 762 | QBitArray OTodoAccessXML::supports()const { |
763 | static QBitArray ar = sup(); | 763 | static QBitArray ar = sup(); |
764 | return ar; | 764 | return ar; |
765 | } | 765 | } |
766 | QBitArray OTodoAccessXML::sup() { | 766 | QBitArray OTodoAccessXML::sup() { |
767 | QBitArray ar( OTodo::CompletedDate +1 ); | 767 | QBitArray ar( OTodo::CompletedDate +1 ); |
768 | ar.fill( true ); | 768 | ar.fill( true ); |
769 | ar[OTodo::CrossReference] = false; | 769 | ar[OTodo::CrossReference] = false; |
770 | ar[OTodo::State ] = false; | 770 | ar[OTodo::State ] = false; |
771 | ar[OTodo::Reminders] = false; | 771 | ar[OTodo::Reminders] = false; |
772 | ar[OTodo::Notifiers] = false; | 772 | ar[OTodo::Notifiers] = false; |
773 | ar[OTodo::Maintainer] = false; | 773 | ar[OTodo::Maintainer] = false; |
774 | 774 | ||
775 | return ar; | 775 | return ar; |
776 | } | 776 | } |
777 | QArray<int> OTodoAccessXML::matchRegexp( const QRegExp &r ) const | ||
778 | { | ||
779 | QArray<int> m_currentQuery( m_events.count() ); | ||
780 | uint arraycounter = 0; | ||
781 | |||
782 | QMap<int, OTodo>::ConstIterator it; | ||
783 | for (it = m_events.begin(); it != m_events.end(); ++it ) { | ||
784 | if ( it.data().match( r ) ) | ||
785 | m_currentQuery[arraycounter++] = it.data().uid(); | ||
786 | |||
787 | } | ||
788 | // Shrink to fit.. | ||
789 | m_currentQuery.resize(arraycounter); | ||
790 | |||
791 | return m_currentQuery; | ||
792 | } | ||