author | zecke <zecke> | 2002-09-12 13:24:35 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-12 13:24:35 (UTC) |
commit | ff3af248587695ad5119057edc5e138acf2664e2 (patch) (unidiff) | |
tree | d7b1bee54be6c2e4688458662e1980f820bd396e | |
parent | e2bc13b329b949f8d0f0d9c21903942d3929c4bb (diff) | |
download | opie-ff3af248587695ad5119057edc5e138acf2664e2.zip opie-ff3af248587695ad5119057edc5e138acf2664e2.tar.gz opie-ff3af248587695ad5119057edc5e138acf2664e2.tar.bz2 |
Ok I thought I removed that
ok now finally remove setRow code from todotable.h
This was committed accidently
-rw-r--r-- | core/pim/todo/todotable.cpp | 22 | ||||
-rw-r--r-- | core/pim/todo/todotable.h | 3 |
2 files changed, 13 insertions, 12 deletions
diff --git a/core/pim/todo/todotable.cpp b/core/pim/todo/todotable.cpp index 779b28c..15f733b 100644 --- a/core/pim/todo/todotable.cpp +++ b/core/pim/todo/todotable.cpp | |||
@@ -226,32 +226,33 @@ TodoTable::TodoTable( QWidget *parent, const char *name ) | |||
226 | : QTable( 0, 4, parent, name ), | 226 | : QTable( 0, 4, parent, name ), |
227 | // #endif | 227 | // #endif |
228 | showComp( true ), | 228 | showComp( true ), |
229 | enablePainting( true ), | 229 | enablePainting( true ), |
230 | mCat( 0 ), | 230 | mCat( 0 ), |
231 | currFindRow( -2 ), | 231 | currFindRow( -2 ), |
232 | showDeadl( true) | 232 | showDeadl( true) |
233 | { | 233 | { |
234 | setNumRows(0); | ||
234 | mCat.load( categoryFileName() ); | 235 | mCat.load( categoryFileName() ); |
235 | setSorting( TRUE ); | 236 | setSorting( TRUE ); |
236 | setSelectionMode( NoSelection ); | 237 | setSelectionMode( NoSelection ); |
237 | setColumnStretchable( 2, TRUE ); | 238 | setColumnStretchable( 2, TRUE ); |
238 | setColumnWidth( 0, 20 ); | 239 | setColumnWidth( 0, 20 ); |
239 | setColumnWidth( 1, 35 ); | 240 | setColumnWidth( 1, 35 ); |
240 | 241 | ||
241 | setLeftMargin( 0 ); | 242 | setLeftMargin( 0 ); |
242 | verticalHeader()->hide(); | 243 | verticalHeader()->hide(); |
243 | horizontalHeader()->setLabel( 0, tr( "C." ) ); | 244 | horizontalHeader()->setLabel( 0, tr( "C." ) ); |
244 | horizontalHeader()->setLabel( 1, tr( "Prior." ) ); | 245 | horizontalHeader()->setLabel( 1, tr( "Prior." ) ); |
245 | horizontalHeader()->setLabel( 2, tr( "Description" ) ); | 246 | horizontalHeader()->setLabel( 2, tr( "Description" ) ); |
246 | 247 | ||
247 | setColumnStretchable( 3, FALSE ); | 248 | setColumnStretchable( 3, FALSE ); |
248 | setColumnWidth( 3, 20 ); | 249 | setColumnWidth( 3, 20 ); |
249 | horizontalHeader()->setLabel( 3, tr( "Deadline" ) ); | 250 | horizontalHeader()->setLabel( 3, tr( "Deadline" ) ); |
250 | 251 | ||
251 | if (showDeadl){ | 252 | if (showDeadl){ |
252 | showColumn (3); | 253 | showColumn (3); |
253 | }else{ | 254 | }else{ |
254 | hideColumn (3); | 255 | hideColumn (3); |
255 | } | 256 | } |
256 | 257 | ||
257 | connect( this, SIGNAL( clicked( int, int, int, const QPoint & ) ), | 258 | connect( this, SIGNAL( clicked( int, int, int, const QPoint & ) ), |
@@ -308,17 +309,17 @@ void TodoTable::slotClicked( int row, int col, int, const QPoint &pos ) | |||
308 | case 2: | 309 | case 2: |
309 | // Show detailed view of the selected entry | 310 | // Show detailed view of the selected entry |
310 | { | 311 | { |
311 | menuTimer->stop(); | 312 | menuTimer->stop(); |
312 | ToDoEvent *todo = todoList[static_cast<CheckItem*>(item(row, 0))]; | 313 | ToDoEvent *todo = todoList[static_cast<CheckItem*>(item(row, 0))]; |
313 | emit showDetails( *todo ); | 314 | emit showDetails( *todo ); |
314 | } | 315 | } |
315 | break; | 316 | break; |
316 | case 3: | 317 | case 3: |
317 | // may as well edit it... | 318 | // may as well edit it... |
318 | menuTimer->stop(); | 319 | menuTimer->stop(); |
319 | emit signalEdit(); | 320 | emit signalEdit(); |
320 | break; | 321 | break; |
321 | } | 322 | } |
322 | } | 323 | } |
323 | 324 | ||
324 | void TodoTable::slotPressed( int row, int col, int, const QPoint &pos ) | 325 | void TodoTable::slotPressed( int row, int col, int, const QPoint &pos ) |
@@ -433,30 +434,33 @@ void TodoTable::load( const QString &fn ) | |||
433 | setCurrentCell( 0, 2 ); | 434 | setCurrentCell( 0, 2 ); |
434 | setSorting(true ); | 435 | setSorting(true ); |
435 | mDayTimer->start( 60 * 1000 ); // gone in 60 seconds? | 436 | mDayTimer->start( 60 * 1000 ); // gone in 60 seconds? |
436 | } | 437 | } |
437 | void TodoTable::updateVisible() | 438 | void TodoTable::updateVisible() |
438 | { | 439 | { |
439 | if ( !isUpdatesEnabled() ) | 440 | if ( !isUpdatesEnabled() ) |
440 | return; | 441 | return; |
441 | 442 | ||
442 | if (showDeadl){ | 443 | if (showDeadl){ |
443 | showColumn (3); | 444 | showColumn (3); |
444 | adjustColumn(3); | 445 | adjustColumn(3); |
445 | }else{ | 446 | }else{ |
446 | hideColumn (3); | 447 | hideColumn (3); |
447 | adjustColumn(2); | 448 | adjustColumn(2); |
448 | } | 449 | } |
449 | 450 | ||
450 | int visible = 0; | 451 | int visible = 0; |
451 | int id = mCat.id( "Todo List", showCat ); | 452 | int id = mCat.id( "Todo List", showCat ); |
452 | for ( int row = 0; row < numRows(); row++ ) { | 453 | for ( int row = 0; row < numRows(); row++ ) { |
453 | CheckItem *ci = (CheckItem *)item( row, 0 ); | 454 | CheckItem *ci = (CheckItem *)item( row, 0 ); |
454 | ToDoEvent *t = todoList[ci]; | 455 | ToDoEvent *t = todoList[ci]; |
456 | if (!t) | ||
457 | continue; | ||
458 | |||
455 | QArray<int> vlCats = t->categories(); | 459 | QArray<int> vlCats = t->categories(); |
456 | bool hide = false; | 460 | bool hide = false; |
457 | if ( !showComp && ci->isChecked() ) | 461 | if ( !showComp && ci->isChecked() ) |
458 | hide = true; | 462 | hide = true; |
459 | if ( !showCat.isEmpty() ) { | 463 | if ( !showCat.isEmpty() ) { |
460 | if ( showCat == tr( "Unfiled" ) ) { | 464 | if ( showCat == tr( "Unfiled" ) ) { |
461 | if ( vlCats.count() > 0 ) | 465 | if ( vlCats.count() > 0 ) |
462 | hide = true; | 466 | hide = true; |
@@ -594,17 +598,17 @@ void TodoTable::loadFile( const QString &/*we use the standard*/ ) | |||
594 | { | 598 | { |
595 | 599 | ||
596 | QList<ToDoEvent> list; | 600 | QList<ToDoEvent> list; |
597 | ToDoDB todoDB; | 601 | ToDoDB todoDB; |
598 | QValueList<ToDoEvent> vaList = todoDB.rawToDos(); | 602 | QValueList<ToDoEvent> vaList = todoDB.rawToDos(); |
599 | for(QValueList<ToDoEvent>::ConstIterator it = vaList.begin(); it != vaList.end(); ++it ){ | 603 | for(QValueList<ToDoEvent>::ConstIterator it = vaList.begin(); it != vaList.end(); ++it ){ |
600 | ToDoEvent *event = new ToDoEvent( (*it) ); | 604 | ToDoEvent *event = new ToDoEvent( (*it) ); |
601 | list.append( event ); | 605 | list.append( event ); |
602 | } | 606 | } |
603 | vaList.clear(); | 607 | vaList.clear(); |
604 | // qDebug("parsing done=%d", t.elapsed() ); | 608 | // qDebug("parsing done=%d", t.elapsed() ); |
605 | if ( list.count() > 0 ) { | 609 | if ( list.count() > 0 ) { |
606 | internalAddEntries( list ); | 610 | internalAddEntries( list ); |
607 | list.clear(); | 611 | list.clear(); |
608 | } | 612 | } |
609 | // qDebug("loading done: t=%d", t.elapsed() ); | 613 | // qDebug("loading done: t=%d", t.elapsed() ); |
610 | } | 614 | } |
@@ -676,17 +680,17 @@ void TodoTable::keyPressEvent( QKeyEvent *e ) | |||
676 | emit showDetails(*todo); | 680 | emit showDetails(*todo); |
677 | break; | 681 | break; |
678 | } | 682 | } |
679 | case 3: | 683 | case 3: |
680 | // Future: Let us change the dueDate directly... | 684 | // Future: Let us change the dueDate directly... |
681 | emit signalEdit(); | 685 | emit signalEdit(); |
682 | default: | 686 | default: |
683 | break; | 687 | break; |
684 | } | 688 | } |
685 | } else | 689 | } else |
686 | QTable::keyPressEvent( e ); | 690 | QTable::keyPressEvent( e ); |
687 | } | 691 | } |
688 | 692 | ||
689 | 693 | ||
690 | QStringList TodoTable::categories() | 694 | QStringList TodoTable::categories() |
691 | { | 695 | { |
692 | // This is called seldom, so calling a load in here | 696 | // This is called seldom, so calling a load in here |
@@ -753,17 +757,17 @@ int TodoTable::showCategoryId() const | |||
753 | { | 757 | { |
754 | int id; | 758 | int id; |
755 | id = -1; | 759 | id = -1; |
756 | // if allcategories are selected, you get unfiled... | 760 | // if allcategories are selected, you get unfiled... |
757 | if ( showCat != tr( "Unfiled" ) && showCat != tr( "All" ) ) | 761 | if ( showCat != tr( "Unfiled" ) && showCat != tr( "All" ) ) |
758 | id = mCat.id( "Todo List", showCat ); | 762 | id = mCat.id( "Todo List", showCat ); |
759 | return id; | 763 | return id; |
760 | } | 764 | } |
761 | void TodoTable::applyJournal() | 765 | void TodoTable::applyJournal() |
762 | { | 766 | { |
763 | // we need to hack | 767 | // we need to hack |
764 | QFile file( journalFileName() ); | 768 | QFile file( journalFileName() ); |
765 | if( file.open(IO_ReadOnly ) ) { | 769 | if( file.open(IO_ReadOnly ) ) { |
766 | QByteArray ar = file.readAll(); | 770 | QByteArray ar = file.readAll(); |
767 | file.close(); | 771 | file.close(); |
768 | QFile file2( journalFileName() + "_new" ); | 772 | QFile file2( journalFileName() + "_new" ); |
769 | if( file2.open(IO_WriteOnly ) ){ | 773 | if( file2.open(IO_WriteOnly ) ){ |
@@ -804,17 +808,17 @@ void TodoTable::applyJournal() | |||
804 | } | 808 | } |
805 | } | 809 | } |
806 | void TodoTable::slotCheckDay() | 810 | void TodoTable::slotCheckDay() |
807 | { | 811 | { |
808 | QDate date = QDate::currentDate(); | 812 | QDate date = QDate::currentDate(); |
809 | if( mDay.daysTo(date )!= 0 ){ | 813 | if( mDay.daysTo(date )!= 0 ){ |
810 | setPaintingEnabled( FALSE ); | 814 | setPaintingEnabled( FALSE ); |
811 | for(int i=0; i < numRows(); i++ ){ | 815 | for(int i=0; i < numRows(); i++ ){ |
812 | ToDoEvent *t = todoList[static_cast<CheckItem*>(item(i, 0))]; | 816 | ToDoEvent *t = todoList[static_cast<CheckItem*>(item(i, 0))]; |
813 | static_cast<DueTextItem*>(item(i, 3) )->setToDoEvent( t ); | 817 | static_cast<DueTextItem*>(item(i, 3) )->setToDoEvent( t ); |
814 | 818 | ||
815 | } | 819 | } |
816 | setPaintingEnabled( TRUE ); | 820 | setPaintingEnabled( TRUE ); |
817 | mDay = date; | 821 | mDay = date; |
818 | } | 822 | } |
819 | mDayTimer->start( 60 * 1000 ); // 60 seconds | 823 | mDayTimer->start( 60 * 1000 ); // 60 seconds |
820 | } | 824 | } |
@@ -913,18 +917,18 @@ static ToDoEvent xmlToEvent( XMLElement *element ) | |||
913 | dummy = element->attribute("Description" ); | 917 | dummy = element->attribute("Description" ); |
914 | event.setDescription( dummy ); | 918 | event.setDescription( dummy ); |
915 | // summary | 919 | // summary |
916 | dummy = element->attribute("Summary" ); | 920 | dummy = element->attribute("Summary" ); |
917 | event.setSummary( dummy ); | 921 | event.setSummary( dummy ); |
918 | // category | 922 | // category |
919 | dummy = element->attribute("Categories" ); | 923 | dummy = element->attribute("Categories" ); |
920 | QStringList ids = QStringList::split(";", dummy ); | 924 | QStringList ids = QStringList::split(";", dummy ); |
921 | event.setCategories( ids ); | 925 | event.setCategories( ids ); |
922 | 926 | ||
923 | //uid | 927 | //uid |
924 | dummy = element->attribute("Uid" ); | 928 | dummy = element->attribute("Uid" ); |
925 | dumInt = dummy.toInt(&ok ); | 929 | dumInt = dummy.toInt(&ok ); |
926 | if(ok ) event.setUid( dumInt ); | 930 | if(ok ) event.setUid( dumInt ); |
927 | return event; | 931 | return event; |
928 | } | 932 | } |
929 | 933 | ||
930 | } | 934 | } |
diff --git a/core/pim/todo/todotable.h b/core/pim/todo/todotable.h index 7539df1..387dddb 100644 --- a/core/pim/todo/todotable.h +++ b/core/pim/todo/todotable.h | |||
@@ -187,19 +187,16 @@ private: | |||
187 | Categories mCat; | 187 | Categories mCat; |
188 | int currFindRow; | 188 | int currFindRow; |
189 | bool showDeadl:1; | 189 | bool showDeadl:1; |
190 | }; | 190 | }; |
191 | 191 | ||
192 | 192 | ||
193 | inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) | 193 | inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) |
194 | { | 194 | { |
195 | int rows = numRows(); | ||
196 | ++rows; | ||
197 | setNumRows( rows ); | ||
198 | QString sortKey = (char) ((todo->isCompleted() ? 'a' : 'A') | 195 | QString sortKey = (char) ((todo->isCompleted() ? 'a' : 'A') |
199 | + todo->priority() ) | 196 | + todo->priority() ) |
200 | + Qtopia::buildSortKey( todo->description() ); | 197 | + Qtopia::buildSortKey( todo->description() ); |
201 | CheckItem *chk = new CheckItem( this, sortKey ); | 198 | CheckItem *chk = new CheckItem( this, sortKey ); |
202 | chk->setChecked( todo->isCompleted() ); | 199 | chk->setChecked( todo->isCompleted() ); |
203 | ComboItem *cmb = new ComboItem( this, QTableItem::WhenCurrent ); | 200 | ComboItem *cmb = new ComboItem( this, QTableItem::WhenCurrent ); |
204 | cmb->setText( QString::number( todo->priority() ) ); | 201 | cmb->setText( QString::number( todo->priority() ) ); |
205 | QString sum = todo->summary(); | 202 | QString sum = todo->summary(); |