summaryrefslogtreecommitdiff
path: root/libopie/pim/otodoaccessxml.cpp
Unidiff
Diffstat (limited to 'libopie/pim/otodoaccessxml.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/otodoaccessxml.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libopie/pim/otodoaccessxml.cpp b/libopie/pim/otodoaccessxml.cpp
index 3d15354..f688735 100644
--- a/libopie/pim/otodoaccessxml.cpp
+++ b/libopie/pim/otodoaccessxml.cpp
@@ -78,25 +78,25 @@ OTodoAccessXML::OTodoAccessXML( const QString& appName,
78} 78}
79OTodoAccessXML::~OTodoAccessXML() { 79OTodoAccessXML::~OTodoAccessXML() {
80 80
81} 81}
82bool OTodoAccessXML::load() { 82bool OTodoAccessXML::load() {
83 rec = 0; 83 rec = 0;
84 m_opened = true; 84 m_opened = true;
85 m_changed = false; 85 m_changed = false;
86 /* initialize dict */ 86 /* initialize dict */
87 /* 87 /*
88 * UPDATE dict if you change anything!!! 88 * UPDATE dict if you change anything!!!
89 */ 89 */
90 QAsciiDict<int> dict(21); 90 QAsciiDict<int> dict(26);
91 dict.setAutoDelete( TRUE ); 91 dict.setAutoDelete( TRUE );
92 dict.insert("Categories" , new int(OTodo::Category) ); 92 dict.insert("Categories" , new int(OTodo::Category) );
93 dict.insert("Uid" , new int(OTodo::Uid) ); 93 dict.insert("Uid" , new int(OTodo::Uid) );
94 dict.insert("HasDate" , new int(OTodo::HasDate) ); 94 dict.insert("HasDate" , new int(OTodo::HasDate) );
95 dict.insert("Completed" , new int(OTodo::Completed) ); 95 dict.insert("Completed" , new int(OTodo::Completed) );
96 dict.insert("Description" , new int(OTodo::Description) ); 96 dict.insert("Description" , new int(OTodo::Description) );
97 dict.insert("Summary" , new int(OTodo::Summary) ); 97 dict.insert("Summary" , new int(OTodo::Summary) );
98 dict.insert("Priority" , new int(OTodo::Priority) ); 98 dict.insert("Priority" , new int(OTodo::Priority) );
99 dict.insert("DateDay" , new int(OTodo::DateDay) ); 99 dict.insert("DateDay" , new int(OTodo::DateDay) );
100 dict.insert("DateMonth" , new int(OTodo::DateMonth) ); 100 dict.insert("DateMonth" , new int(OTodo::DateMonth) );
101 dict.insert("DateYear" , new int(OTodo::DateYear) ); 101 dict.insert("DateYear" , new int(OTodo::DateYear) );
102 dict.insert("Progress" , new int(OTodo::Progress) ); 102 dict.insert("Progress" , new int(OTodo::Progress) );
@@ -827,28 +827,30 @@ QArray<int> OTodoAccessXML::sorted( bool asc, int sortOrder,
827 } 827 }
828 vector.resize( item ); 828 vector.resize( item );
829 /* sort it now */ 829 /* sort it now */
830 vector.sort(); 830 vector.sort();
831 /* now get the uids */ 831 /* now get the uids */
832 QArray<int> array( vector.count() ); 832 QArray<int> array( vector.count() );
833 for (uint i= 0; i < vector.count(); i++ ) { 833 for (uint i= 0; i < vector.count(); i++ ) {
834 array[i] = ( vector.at(i) )->todo.uid(); 834 array[i] = ( vector.at(i) )->todo.uid();
835 } 835 }
836 return array; 836 return array;
837}; 837};
838void OTodoAccessXML::removeAllCompleted() { 838void OTodoAccessXML::removeAllCompleted() {
839 QMap<int, OTodo> events = m_events;
839 for ( QMap<int, OTodo>::Iterator it = m_events.begin(); it != m_events.end(); ++it ) { 840 for ( QMap<int, OTodo>::Iterator it = m_events.begin(); it != m_events.end(); ++it ) {
840 if ( (*it).isCompleted() ) 841 if ( (*it).isCompleted() )
841 m_events.remove( it ); 842 events.remove( it.key() );
842 } 843 }
844 m_events = events;
843} 845}
844QBitArray OTodoAccessXML::supports()const { 846QBitArray OTodoAccessXML::supports()const {
845 static QBitArray ar = sup(); 847 static QBitArray ar = sup();
846 return ar; 848 return ar;
847} 849}
848QBitArray OTodoAccessXML::sup() { 850QBitArray OTodoAccessXML::sup() {
849 QBitArray ar( OTodo::CompletedDate +1 ); 851 QBitArray ar( OTodo::CompletedDate +1 );
850 ar.fill( true ); 852 ar.fill( true );
851 ar[OTodo::CrossReference] = false; 853 ar[OTodo::CrossReference] = false;
852 ar[OTodo::State ] = false; 854 ar[OTodo::State ] = false;
853 ar[OTodo::Reminders] = false; 855 ar[OTodo::Reminders] = false;
854 ar[OTodo::Notifiers] = false; 856 ar[OTodo::Notifiers] = false;