author | zecke <zecke> | 2002-06-15 16:46:37 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-15 16:46:37 (UTC) |
commit | ff47b17768607d8819ef5cd3316a1cab0abdcf3a (patch) (unidiff) | |
tree | addbc4d7d8826ce2952aca872e67e3575d77cda7 /core/pim/todo/todotable.cpp | |
parent | 9f41969610f9db5d60d6080abae0b21e54a549e2 (diff) | |
download | opie-ff47b17768607d8819ef5cd3316a1cab0abdcf3a.zip opie-ff47b17768607d8819ef5cd3316a1cab0abdcf3a.tar.gz opie-ff47b17768607d8819ef5cd3316a1cab0abdcf3a.tar.bz2 |
Summary support
-rw-r--r-- | core/pim/todo/todotable.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/pim/todo/todotable.cpp b/core/pim/todo/todotable.cpp index 52a3087..779b28c 100644 --- a/core/pim/todo/todotable.cpp +++ b/core/pim/todo/todotable.cpp | |||
@@ -563,24 +563,25 @@ void TodoTable::updateJournal( const ToDoEvent &todo, journal_action action ) | |||
563 | buf += " Completed=\""+ QString::number((int)todo.isCompleted() ) + "\""; | 563 | buf += " Completed=\""+ QString::number((int)todo.isCompleted() ) + "\""; |
564 | buf += " HasDate=\""+ QString::number((int)todo.hasDate() ) +"\""; | 564 | buf += " HasDate=\""+ QString::number((int)todo.hasDate() ) +"\""; |
565 | buf += " Priority=\"" + QString::number( todo.priority() ) + "\""; | 565 | buf += " Priority=\"" + QString::number( todo.priority() ) + "\""; |
566 | QArray<int> arrat = todo.categories(); | 566 | QArray<int> arrat = todo.categories(); |
567 | QString attr; | 567 | QString attr; |
568 | for(uint i=0; i < arrat.count(); i++ ){ | 568 | for(uint i=0; i < arrat.count(); i++ ){ |
569 | attr.append(QString::number(arrat[i])+";" ); | 569 | attr.append(QString::number(arrat[i])+";" ); |
570 | } | 570 | } |
571 | if(!attr.isEmpty() ) // remove the last ; | 571 | if(!attr.isEmpty() ) // remove the last ; |
572 | attr.remove(attr.length()-1, 1 ); | 572 | attr.remove(attr.length()-1, 1 ); |
573 | buf += " Categories=\"" + attr + "\""; | 573 | buf += " Categories=\"" + attr + "\""; |
574 | buf += " Description=\"" + todo.description() + "\""; | 574 | buf += " Description=\"" + todo.description() + "\""; |
575 | buf += " Summary=\"" + todo.summary() + "\""; | ||
575 | if(todo.hasDate() ) { | 576 | if(todo.hasDate() ) { |
576 | buf += " DateYear=\""+QString::number( todo.date().year() ) + "\""; | 577 | buf += " DateYear=\""+QString::number( todo.date().year() ) + "\""; |
577 | buf += " DateMonth=\"" + QString::number( todo.date().month() ) + "\""; | 578 | buf += " DateMonth=\"" + QString::number( todo.date().month() ) + "\""; |
578 | buf += " DateDay=\"" + QString::number( todo.date().day() ) + "\""; | 579 | buf += " DateDay=\"" + QString::number( todo.date().day() ) + "\""; |
579 | } | 580 | } |
580 | buf += "/>\n"; | 581 | buf += "/>\n"; |
581 | str = buf.utf8(); | 582 | str = buf.utf8(); |
582 | f.writeBlock( str.data(), str.length() ); | 583 | f.writeBlock( str.data(), str.length() ); |
583 | f.close(); | 584 | f.close(); |
584 | } | 585 | } |
585 | 586 | ||
586 | void TodoTable::rowHeightChanged( int row ) | 587 | void TodoTable::rowHeightChanged( int row ) |
@@ -601,26 +602,29 @@ void TodoTable::loadFile( const QString &/*we use the standard*/ ) | |||
601 | } | 602 | } |
602 | vaList.clear(); | 603 | vaList.clear(); |
603 | // qDebug("parsing done=%d", t.elapsed() ); | 604 | // qDebug("parsing done=%d", t.elapsed() ); |
604 | if ( list.count() > 0 ) { | 605 | if ( list.count() > 0 ) { |
605 | internalAddEntries( list ); | 606 | internalAddEntries( list ); |
606 | list.clear(); | 607 | list.clear(); |
607 | } | 608 | } |
608 | // qDebug("loading done: t=%d", t.elapsed() ); | 609 | // qDebug("loading done: t=%d", t.elapsed() ); |
609 | } | 610 | } |
610 | 611 | ||
611 | void TodoTable::journalFreeReplaceEntry( const ToDoEvent &todo, int row ) | 612 | void TodoTable::journalFreeReplaceEntry( const ToDoEvent &todo, int row ) |
612 | { | 613 | { |
613 | QString strTodo; | 614 | QString strTodo = todo.summary(); |
614 | strTodo = todo.description().left(40).simplifyWhiteSpace(); | 615 | if( strTodo.isEmpty() ){ |
616 | strTodo = todo.description().left(40).simplifyWhiteSpace(); | ||
617 | //todo.setSummary(strTodo ); | ||
618 | } | ||
615 | if ( row == -1 ) { | 619 | if ( row == -1 ) { |
616 | QMapIterator<CheckItem*, ToDoEvent *> it; | 620 | QMapIterator<CheckItem*, ToDoEvent *> it; |
617 | for ( it = todoList.begin(); it != todoList.end(); ++it ) { | 621 | for ( it = todoList.begin(); it != todoList.end(); ++it ) { |
618 | if ( *(*it) == todo ) { | 622 | if ( *(*it) == todo ) { |
619 | row = it.key()->row(); | 623 | row = it.key()->row(); |
620 | it.key()->setChecked( todo.isCompleted() ); | 624 | it.key()->setChecked( todo.isCompleted() ); |
621 | static_cast<ComboItem*>(item(row, 1))->setText( QString::number(todo.priority()) ); | 625 | static_cast<ComboItem*>(item(row, 1))->setText( QString::number(todo.priority()) ); |
622 | item( row, 2 )->setText( strTodo ); | 626 | item( row, 2 )->setText( strTodo ); |
623 | 627 | ||
624 | if (showDeadl){ | 628 | if (showDeadl){ |
625 | static_cast<DueTextItem*>(item(row,3))->setToDoEvent(&todo ); | 629 | static_cast<DueTextItem*>(item(row,3))->setToDoEvent(&todo ); |
626 | } | 630 | } |
@@ -899,24 +903,27 @@ static ToDoEvent xmlToEvent( XMLElement *element ) | |||
899 | if(ok ) day = dumInt; | 903 | if(ok ) day = dumInt; |
900 | // set the date | 904 | // set the date |
901 | QDate date( year, month, day ); | 905 | QDate date( year, month, day ); |
902 | event.setDate( date); | 906 | event.setDate( date); |
903 | } | 907 | } |
904 | dummy = element->attribute("Priority" ); | 908 | dummy = element->attribute("Priority" ); |
905 | dumInt = dummy.toInt(&ok ); | 909 | dumInt = dummy.toInt(&ok ); |
906 | if(!ok ) dumInt = ToDoEvent::NORMAL; | 910 | if(!ok ) dumInt = ToDoEvent::NORMAL; |
907 | event.setPriority( dumInt ); | 911 | event.setPriority( dumInt ); |
908 | //description | 912 | //description |
909 | dummy = element->attribute("Description" ); | 913 | dummy = element->attribute("Description" ); |
910 | event.setDescription( dummy ); | 914 | event.setDescription( dummy ); |
915 | // summary | ||
916 | dummy = element->attribute("Summary" ); | ||
917 | event.setSummary( dummy ); | ||
911 | // category | 918 | // category |
912 | dummy = element->attribute("Categories" ); | 919 | dummy = element->attribute("Categories" ); |
913 | QStringList ids = QStringList::split(";", dummy ); | 920 | QStringList ids = QStringList::split(";", dummy ); |
914 | event.setCategories( ids ); | 921 | event.setCategories( ids ); |
915 | 922 | ||
916 | //uid | 923 | //uid |
917 | dummy = element->attribute("Uid" ); | 924 | dummy = element->attribute("Uid" ); |
918 | dumInt = dummy.toInt(&ok ); | 925 | dumInt = dummy.toInt(&ok ); |
919 | if(ok ) event.setUid( dumInt ); | 926 | if(ok ) event.setUid( dumInt ); |
920 | return event; | 927 | return event; |
921 | } | 928 | } |
922 | 929 | ||