summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/tableview.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp
index 3daf370..d980a24 100644
--- a/core/pim/todo/tableview.cpp
+++ b/core/pim/todo/tableview.cpp
@@ -593,19 +593,28 @@ void TableView::keyPressEvent( QKeyEvent* event) {
// setCellContentFromEditor(m_editorWidget.cellRow(), m_editorWidget.cellCol() );
endEdit(m_editorWidget.cellRow(), m_editorWidget.cellCol(),
true, true );
m_editorWidget.releaseCellWidget();
setFocus();
}
+
+ if ( sorted().count() < 1 ) {
+ QTable::keyPressEvent( event );
+ return;
+ }
+
int row = currentRow();
int col = currentColumn();
char key = ::toupper( event->ascii() );
- /* let QTable also handle the d later */
- if ( key == 'D' )
+ /* let QTable also handle the d letter */
+ if ( key == 'D' ) {
+ event->accept();
removeQuery( sorted().uidAt( row ) );
+ return;
+ }
switch( event->key() ) {
case Qt::Key_F33:
case Qt::Key_Enter:
case Qt::Key_Return:
@@ -617,13 +626,13 @@ void TableView::keyPressEvent( QKeyEvent* event) {
m_editorWidget.setCellWidget( wid, row, col );
}else if ( col == 2 ) {
showTodo( sorted().uidAt( currentRow() ) );
}else if ( col == 3 ) {
TodoView::edit( sorted().uidAt(row) );
}
-
+ event->accept();
break;
default:
QTable::keyPressEvent( event );
}
}