summaryrefslogtreecommitdiff
path: root/core
authorzecke <zecke>2002-09-12 13:24:35 (UTC)
committer zecke <zecke>2002-09-12 13:24:35 (UTC)
commitff3af248587695ad5119057edc5e138acf2664e2 (patch) (side-by-side diff)
treed7b1bee54be6c2e4688458662e1980f820bd396e /core
parente2bc13b329b949f8d0f0d9c21903942d3929c4bb (diff)
downloadopie-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
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/todotable.cpp22
-rw-r--r--core/pim/todo/todotable.h3
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
@@ -228,12 +228,13 @@ TodoTable::TodoTable( QWidget *parent, const char *name )
showComp( true ),
enablePainting( true ),
mCat( 0 ),
currFindRow( -2 ),
showDeadl( true)
{
+ setNumRows(0);
mCat.load( categoryFileName() );
setSorting( TRUE );
setSelectionMode( NoSelection );
setColumnStretchable( 2, TRUE );
setColumnWidth( 0, 20 );
setColumnWidth( 1, 35 );
@@ -243,13 +244,13 @@ TodoTable::TodoTable( QWidget *parent, const char *name )
horizontalHeader()->setLabel( 0, tr( "C." ) );
horizontalHeader()->setLabel( 1, tr( "Prior." ) );
horizontalHeader()->setLabel( 2, tr( "Description" ) );
setColumnStretchable( 3, FALSE );
setColumnWidth( 3, 20 );
- horizontalHeader()->setLabel( 3, tr( "Deadline" ) );
+ horizontalHeader()->setLabel( 3, tr( "Deadline" ) );
if (showDeadl){
showColumn (3);
}else{
hideColumn (3);
}
@@ -310,13 +311,13 @@ void TodoTable::slotClicked( int row, int col, int, const QPoint &pos )
{
menuTimer->stop();
ToDoEvent *todo = todoList[static_cast<CheckItem*>(item(row, 0))];
emit showDetails( *todo );
}
break;
- case 3:
+ case 3:
// may as well edit it...
menuTimer->stop();
emit signalEdit();
break;
}
}
@@ -435,13 +436,13 @@ void TodoTable::load( const QString &fn )
mDayTimer->start( 60 * 1000 ); // gone in 60 seconds?
}
void TodoTable::updateVisible()
{
if ( !isUpdatesEnabled() )
return;
-
+
if (showDeadl){
showColumn (3);
adjustColumn(3);
}else{
hideColumn (3);
adjustColumn(2);
@@ -449,12 +450,15 @@ void TodoTable::updateVisible()
int visible = 0;
int id = mCat.id( "Todo List", showCat );
for ( int row = 0; row < numRows(); row++ ) {
CheckItem *ci = (CheckItem *)item( row, 0 );
ToDoEvent *t = todoList[ci];
+ if (!t)
+ continue;
+
QArray<int> vlCats = t->categories();
bool hide = false;
if ( !showComp && ci->isChecked() )
hide = true;
if ( !showCat.isEmpty() ) {
if ( showCat == tr( "Unfiled" ) ) {
@@ -596,13 +600,13 @@ void TodoTable::loadFile( const QString &/*we use the standard*/ )
QList<ToDoEvent> list;
ToDoDB todoDB;
QValueList<ToDoEvent> vaList = todoDB.rawToDos();
for(QValueList<ToDoEvent>::ConstIterator it = vaList.begin(); it != vaList.end(); ++it ){
ToDoEvent *event = new ToDoEvent( (*it) );
list.append( event );
- }
+ }
vaList.clear();
// qDebug("parsing done=%d", t.elapsed() );
if ( list.count() > 0 ) {
internalAddEntries( list );
list.clear();
}
@@ -678,13 +682,13 @@ void TodoTable::keyPressEvent( QKeyEvent *e )
}
case 3:
// Future: Let us change the dueDate directly...
emit signalEdit();
default:
break;
- }
+ }
} else
QTable::keyPressEvent( e );
}
QStringList TodoTable::categories()
@@ -755,13 +759,13 @@ int TodoTable::showCategoryId() const
id = -1;
// if allcategories are selected, you get unfiled...
if ( showCat != tr( "Unfiled" ) && showCat != tr( "All" ) )
id = mCat.id( "Todo List", showCat );
return id;
}
-void TodoTable::applyJournal()
+void TodoTable::applyJournal()
{
// we need to hack
QFile file( journalFileName() );
if( file.open(IO_ReadOnly ) ) {
QByteArray ar = file.readAll();
file.close();
@@ -806,13 +810,13 @@ void TodoTable::applyJournal()
void TodoTable::slotCheckDay()
{
QDate date = QDate::currentDate();
if( mDay.daysTo(date )!= 0 ){
setPaintingEnabled( FALSE );
for(int i=0; i < numRows(); i++ ){
- ToDoEvent *t = todoList[static_cast<CheckItem*>(item(i, 0))];
+ ToDoEvent *t = todoList[static_cast<CheckItem*>(item(i, 0))];
static_cast<DueTextItem*>(item(i, 3) )->setToDoEvent( t );
}
setPaintingEnabled( TRUE );
mDay = date;
}
@@ -915,14 +919,14 @@ static ToDoEvent xmlToEvent( XMLElement *element )
// summary
dummy = element->attribute("Summary" );
event.setSummary( dummy );
// category
dummy = element->attribute("Categories" );
QStringList ids = QStringList::split(";", dummy );
- event.setCategories( ids );
-
+ event.setCategories( ids );
+
//uid
dummy = element->attribute("Uid" );
dumInt = dummy.toInt(&ok );
if(ok ) event.setUid( dumInt );
return event;
}
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
@@ -189,15 +189,12 @@ private:
bool showDeadl:1;
};
inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row )
{
- int rows = numRows();
- ++rows;
- setNumRows( rows );
QString sortKey = (char) ((todo->isCompleted() ? 'a' : 'A')
+ todo->priority() )
+ Qtopia::buildSortKey( todo->description() );
CheckItem *chk = new CheckItem( this, sortKey );
chk->setChecked( todo->isCompleted() );
ComboItem *cmb = new ComboItem( this, QTableItem::WhenCurrent );