summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 82c0f4c..00c2d97 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -393,49 +393,49 @@ void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e)
393} 393}
394void KOTodoListView::keyReleaseEvent ( QKeyEvent *e ) 394void KOTodoListView::keyReleaseEvent ( QKeyEvent *e )
395{ 395{
396 if ( !e->isAutoRepeat() ) { 396 if ( !e->isAutoRepeat() ) {
397 mFlagKeyPressed = false; 397 mFlagKeyPressed = false;
398 } 398 }
399} 399}
400 400
401 401
402void KOTodoListView::keyPressEvent ( QKeyEvent * e ) 402void KOTodoListView::keyPressEvent ( QKeyEvent * e )
403{ 403{
404 qApp->processEvents(); 404 qApp->processEvents();
405 if ( !isVisible() ) { 405 if ( !isVisible() ) {
406 e->ignore(); 406 e->ignore();
407 return; 407 return;
408 } 408 }
409 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 409 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
410 e->ignore(); 410 e->ignore();
411 // qDebug(" ignore %d",e->isAutoRepeat() ); 411 // qDebug(" ignore %d",e->isAutoRepeat() );
412 return; 412 return;
413 } 413 }
414 if (! e->isAutoRepeat() ) 414 if (! e->isAutoRepeat() )
415 mFlagKeyPressed = true; 415 mFlagKeyPressed = true;
416 QListViewItem* cn; 416 QListViewItem* cn;
417 if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { 417 if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") {
418 cn = currentItem(); 418 cn = currentItem();
419 if ( cn ) { 419 if ( cn ) {
420 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 420 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
421 if ( ci ){ 421 if ( ci ){
422 if ( e->state() == ShiftButton ) 422 if ( e->state() == ShiftButton )
423 ci->setOn( false ); 423 ci->setOn( false );
424 else 424 else
425 ci->setOn( true ); 425 ci->setOn( true );
426 cn = cn->itemBelow(); 426 cn = cn->itemBelow();
427 if ( cn ) { 427 if ( cn ) {
428 setCurrentItem ( cn ); 428 setCurrentItem ( cn );
429 ensureItemVisible ( cn ); 429 ensureItemVisible ( cn );
430 } 430 }
431 431
432 } 432 }
433 } 433 }
434 434
435 e->accept(); 435 e->accept();
436 return; 436 return;
437 } 437 }
438 438
439 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { 439 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) {
440 switch ( e->key() ) { 440 switch ( e->key() ) {
441 case Qt::Key_Down: 441 case Qt::Key_Down:
@@ -1671,54 +1671,51 @@ void KOTodoView::keyPressEvent ( QKeyEvent * e )
1671 e->accept(); 1671 e->accept();
1672 } else 1672 } else
1673 e->ignore(); 1673 e->ignore();
1674 break; 1674 break;
1675 default: 1675 default:
1676 e->ignore(); 1676 e->ignore();
1677 } 1677 }
1678 1678
1679 if ( true ) { 1679 if ( true ) {
1680 if ( e->key() == Qt::Key_I ) { 1680 if ( e->key() == Qt::Key_I ) {
1681 KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); 1681 KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem();
1682 if ( cn ) { 1682 if ( cn ) {
1683 mActiveItem = cn; 1683 mActiveItem = cn;
1684 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 1684 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
1685 if ( ci ){ 1685 if ( ci ){
1686 showTodo(); 1686 showTodo();
1687 cn = (KOTodoViewItem*)cn->itemBelow(); 1687 cn = (KOTodoViewItem*)cn->itemBelow();
1688 if ( cn ) { 1688 if ( cn ) {
1689 mTodoListView->setCurrentItem ( cn ); 1689 mTodoListView->setCurrentItem ( cn );
1690 mTodoListView->ensureItemVisible ( cn ); 1690 mTodoListView->ensureItemVisible ( cn );
1691 } 1691 }
1692 1692
1693 } 1693 }
1694 } 1694 }
1695 e->accept(); 1695 e->accept();
1696
1697 } 1696 }
1698
1699 } 1697 }
1700
1701} 1698}
1702void KOTodoView::updateTodo( Todo * t, int type ) 1699void KOTodoView::updateTodo( Todo * t, int type )
1703{ 1700{
1704 if ( mBlockUpdate) 1701 if ( mBlockUpdate)
1705 return; 1702 return;
1706 1703
1707 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; 1704 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator;
1708 itemIterator = mTodoMap.find(t); 1705 itemIterator = mTodoMap.find(t);
1709 if (itemIterator != mTodoMap.end()) { 1706 if (itemIterator != mTodoMap.end()) {
1710 (*itemIterator)->construct(); 1707 (*itemIterator)->construct();
1711 } else { 1708 } else {
1712 if ( type == KOGlobals::EVENTADDED ) { 1709 if ( type == KOGlobals::EVENTADDED ) {
1713 insertTodoItem( t ); 1710 insertTodoItem( t );
1714 } 1711 }
1715 } 1712 }
1716 1713
1717} 1714}
1718 1715
1719void KOTodoView::todoModified(Todo * t , int p ) 1716void KOTodoView::todoModified(Todo * t , int p )
1720{ 1717{
1721 mBlockUpdate = true; 1718 mBlockUpdate = true;
1722 emit todoModifiedSignal ( t, p ); 1719 emit todoModifiedSignal ( t, p );
1723 mBlockUpdate = false; 1720 mBlockUpdate = false;
1724} 1721}