-rw-r--r-- | core/pim/todo/mainwindow.cpp | 3 | ||||
-rw-r--r-- | core/pim/todo/todotable.cpp | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index a28fc3e..294f37c 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp @@ -351,58 +351,59 @@ void TodoWindow::slotDeleteAll() return; table->setPaintingEnabled( false ); table->removeAllEntries(); table->setPaintingEnabled( true ); if ( table->numRows() == 0 ) { currentEntryChanged( -1, 0 ); findAction->setEnabled( FALSE ); } mStack->raiseWidget(1 ); } void TodoWindow::slotEdit() { if(syncing) { QMessageBox::warning(this, tr("Todo"), tr("Can not edit data, currently syncing")); return; } ToDoEvent todo = table->currentEntry(); - + qWarning("slotEdit" ); NewTaskDialog e( todo, this, 0, TRUE ); e.setCaption( tr( "Edit Task" ) ); #if defined(Q_WS_QWS) || defined(_WS_QWS_) e.showMaximized(); #endif int ret = e.exec(); if ( ret == QDialog::Accepted ) { + qWarning("Replacing now" ); table->setPaintingEnabled( false ); todo = e.todoEntry(); table->replaceCurrentEntry( todo ); table->setPaintingEnabled( true ); } populateCategories(); mStack->raiseWidget( 1 ); } void TodoWindow::slotDuplicate() { if(syncing) { QMessageBox::warning(this, tr("Todo"), tr("Can not edit data, currently syncing")); return; } ToDoEvent ev = table->currentEntry(); ToDoEvent ev2 = ToDoEvent( ev ); // what about the uid int uid; { // uid Qtopia::UidGen *uidgen = new Qtopia::UidGen(); uid = uidgen->generate(); delete uidgen; } ev2.setUid( uid ); diff --git a/core/pim/todo/todotable.cpp b/core/pim/todo/todotable.cpp index dc60cc4..208a084 100644 --- a/core/pim/todo/todotable.cpp +++ b/core/pim/todo/todotable.cpp @@ -620,50 +620,49 @@ void TodoTable::journalFreeReplaceEntry( const ToDoEvent &todo, int row ) if ( *(*it) == todo ) { row = it.key()->row(); it.key()->setChecked( todo.isCompleted() ); static_cast<ComboItem*>(item(row, 1))->setText( QString::number(todo.priority()) ); item( row, 2 )->setText( strTodo ); if (showDeadl){ static_cast<DueTextItem*>(item(row,3))->setToDoEvent(&todo ); } *(*it) = todo; } } } else { ToDoEvent *t = todoList[static_cast<CheckItem*>(item(row, 0))]; todoList.remove( static_cast<CheckItem*>(item(row, 0)) ); delete t; static_cast<CheckItem*>(item(row, 0))->setChecked( todo.isCompleted() ); static_cast<ComboItem*>(item(row, 1))->setText( QString::number(todo.priority()) ); item( row, 2 )->setText( strTodo ); if (showDeadl){ static_cast<DueTextItem*>(item(row,3))->setToDoEvent(&todo ); } - ToDoEvent *ev = new ToDoEvent( todo ); - todoList.insert( static_cast<CheckItem*>(item(row,0)), new ToDoEvent(ev) ); + todoList.insert( static_cast<CheckItem*>(item(row,0)), new ToDoEvent(todo) ); } } void TodoTable::journalFreeRemoveEntry( int row ) { CheckItem *chk; chk = static_cast<CheckItem*>(item(row, 0 )); if ( !chk ) return; todoList.remove( chk ); realignTable( row ); } void TodoTable::keyPressEvent( QKeyEvent *e ) { if ( e->key() == Key_Space || e->key() == Key_Return ) { switch ( currentColumn() ) { case 0: { CheckItem *i = static_cast<CheckItem*>(item(currentRow(), currentColumn())); if ( i ) i->toggle(); break; |