summaryrefslogtreecommitdiff
path: root/libopie2/opiepim
authorzecke <zecke>2002-10-07 23:54:18 (UTC)
committer zecke <zecke>2002-10-07 23:54:18 (UTC)
commit02464ee120e2661d1fb30b0743ce64626c2d3133 (patch) (unidiff)
treef53d7f4c91eaee616b3c67401bd213dbfad57d43 /libopie2/opiepim
parentdbdc38993798a0e223437908a46846b16541f843 (diff)
downloadopie-02464ee120e2661d1fb30b0743ce64626c2d3133.zip
opie-02464ee120e2661d1fb30b0743ce64626c2d3133.tar.gz
opie-02464ee120e2661d1fb30b0743ce64626c2d3133.tar.bz2
Fix sorted stuff
Case number 4 is still to go
Diffstat (limited to 'libopie2/opiepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/otodoaccessxml.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp
index 80b8599..f3b0783 100644
--- a/libopie2/opiepim/backend/otodoaccessxml.cpp
+++ b/libopie2/opiepim/backend/otodoaccessxml.cpp
@@ -445,7 +445,6 @@ public:
445 * 445 *
446 */ 446 */
447 int compareItems( Item d1, Item d2 ) { 447 int compareItems( Item d1, Item d2 ) {
448 qWarning("compare items");
449 int ret =0; 448 int ret =0;
450 OTodoXMLContainer* con1 = (OTodoXMLContainer*)d1; 449 OTodoXMLContainer* con1 = (OTodoXMLContainer*)d1;
451 OTodoXMLContainer* con2 = (OTodoXMLContainer*)d2; 450 OTodoXMLContainer* con2 = (OTodoXMLContainer*)d2;
@@ -453,7 +452,6 @@ public:
453 /* same item */ 452 /* same item */
454 if ( con1->todo.uid() == con2->todo.uid() ) 453 if ( con1->todo.uid() == con2->todo.uid() )
455 return 0; 454 return 0;
456 qWarning("m_sort %d", m_sort );
457 455
458 switch ( m_sort ) { 456 switch ( m_sort ) {
459 /* completed */ 457 /* completed */
@@ -487,6 +485,8 @@ public:
487 if ( con1->todo.hasDueDate() && 485 if ( con1->todo.hasDueDate() &&
488 con2->todo.hasDueDate() ) 486 con2->todo.hasDueDate() )
489 ret = con1->todo.dueDate().daysTo( con2->todo.dueDate() ); 487 ret = con1->todo.dueDate().daysTo( con2->todo.dueDate() );
488
489
490 else if ( con1->todo.hasDueDate() ) 490 else if ( con1->todo.hasDueDate() )
491 ret = -1; 491 ret = -1;
492 else if ( con2->todo.hasDueDate() ) 492 else if ( con2->todo.hasDueDate() )
@@ -511,21 +511,21 @@ public:
511 511
512QArray<int> OTodoAccessXML::sorted( bool asc, int sortOrder, 512QArray<int> OTodoAccessXML::sorted( bool asc, int sortOrder,
513 int sortFilter, int cat ) { 513 int sortFilter, int cat ) {
514 qWarning("sorted! %d cat", cat);
514 OTodoXMLVector vector(m_events.count(), asc,sortOrder ); 515 OTodoXMLVector vector(m_events.count(), asc,sortOrder );
515 QMap<int, OTodo>::Iterator it; 516 QMap<int, OTodo>::Iterator it;
516 int item = 0; 517 int item = 0;
517 518
518 bool bCat = sortFilter & 1 ? true : false; 519 bool bCat = sortFilter & 1 ? true : false;
519 bool bOver = sortFilter & 0 ? true : false;
520 bool bOnly = sortFilter & 2 ? true : false; 520 bool bOnly = sortFilter & 2 ? true : false;
521 for ( it = m_events.begin(); it != m_events.end(); ++it ) { 521 for ( it = m_events.begin(); it != m_events.end(); ++it ) {
522 522
523 /* show category */ 523 /* show category */
524 if ( bCat ) 524 if ( bCat && cat != 0)
525 if (!(*it).categories().contains( cat ) ) 525 if (!(*it).categories().contains( cat ) )
526 continue; 526 continue;
527 /* isOverdue but we should not show overdue */ 527 /* isOverdue but we should not show overdue */
528 if ( (*it).isOverdue() && ( !bOver || !bOnly ) ) 528 if ( (*it).isOverdue() && !bOnly )
529 continue; 529 continue;
530 if ( !(*it).isOverdue() && bOnly ) 530 if ( !(*it).isOverdue() && bOnly )
531 continue; 531 continue;
@@ -544,5 +544,6 @@ QArray<int> OTodoAccessXML::sorted( bool asc, int sortOrder,
544 for (uint i= 0; i < vector.count(); i++ ) { 544 for (uint i= 0; i < vector.count(); i++ ) {
545 array[i] = ( vector.at(i) )->todo.uid(); 545 array[i] = ( vector.at(i) )->todo.uid();
546 } 546 }
547 qWarning("array count = %d %d", array.count(), vector.count() );
547 return array; 548 return array;
548}; 549};