summaryrefslogtreecommitdiff
path: root/core/pim/todo/todotable.h
Side-by-side diff
Diffstat (limited to 'core/pim/todo/todotable.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/todotable.h3
1 files changed, 0 insertions, 3 deletions
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
@@ -147,99 +147,96 @@ signals:
void signalNotFound();
void signalWrapAround();
void showDetails( const ToDoEvent & );
protected:
void keyPressEvent( QKeyEvent *e );
private:
void updateVisible();
void viewportPaintEvent( QPaintEvent * );
void internalAddEntries( QList<ToDoEvent> &list);
inline void insertIntoTable( ToDoEvent *todo, int row );
void updateJournal( const ToDoEvent &todo, journal_action action);
void mergeJournal();
void journalFreeReplaceEntry( const ToDoEvent &todo, int row );
void journalFreeRemoveEntry( int row );
inline void realignTable( int row );
void loadFile( const QString &strFile);
private slots:
void slotClicked( int row, int col, int button, const QPoint &pos );
void slotPressed( int row, int col, int button, const QPoint &pos );
void slotCheckPriority(int row, int col );
void slotCurrentChanged(int row, int col );
void slotDoFind( const QString &findString, bool caseSensetive,
bool backwards, int category );
void slotShowMenu();
void rowHeightChanged( int row );
void slotCheckDay(); // check the day
private:
friend class TodoWindow;
QMap<CheckItem*, ToDoEvent *> todoList;
QStringList categoryList;
bool showComp;
QString showCat;
QTimer *menuTimer;
QDate mDay;
QTimer *mDayTimer; // see if the day changed
bool enablePainting;
Categories mCat;
int currFindRow;
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 );
cmb->setText( QString::number( todo->priority() ) );
QString sum = todo->summary();
QTableItem *ti = new TodoTextItem( this, sum.isEmpty() ? todo->description().left(40).simplifyWhiteSpace() : sum );
ti->setReplaceable( false );
DueTextItem *due = new DueTextItem(this, todo );
setItem( row, 3, due);
setItem( row, 0, chk );
setItem( row, 1, cmb );
setItem( row, 2, ti );
todoList.insert( chk, todo );
}
inline void TodoTable::realignTable( int row )
{
QTableItem *ti1,
*ti2,
*ti3,
*ti4;
int totalRows = numRows();
for ( int curr = row; curr < totalRows - 1; curr++ ) {
// this is bad, we must take the item out and then
// set it. In the end, it behaves no worse (time wise)
// then the old way of saving the entries to file, clearing
// the table re-reading in the file and resetting the table
ti1 = item( curr + 1, 0 );
ti2 = item( curr + 1, 1 );
ti3 = item( curr + 1, 2 );
ti4 = item( curr + 1, 3 );
takeItem( ti1 );
takeItem( ti2 );
takeItem( ti3 );
takeItem( ti4 );
setItem( curr, 0, ti1 );
setItem( curr, 1, ti2 );
setItem( curr, 2, ti3 );
setItem( curr, 3, ti4 );
}
setNumRows( totalRows - 1 );