-rw-r--r-- | korganizer/kolistview.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index d3aa650..3d4acb7 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -961,96 +961,97 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e) | |||
961 | QListViewItem* cn; | 961 | QListViewItem* cn; |
962 | cn = currentItem(); | 962 | cn = currentItem(); |
963 | if ( cn ) { | 963 | if ( cn ) { |
964 | KOListViewItem* ci = (KOListViewItem*)( cn ); | 964 | KOListViewItem* ci = (KOListViewItem*)( cn ); |
965 | if ( ci ){ | 965 | if ( ci ){ |
966 | emit showIncidence( ci->data()); | 966 | emit showIncidence( ci->data()); |
967 | cn = cn->nextSibling(); | 967 | cn = cn->nextSibling(); |
968 | if ( cn ) { | 968 | if ( cn ) { |
969 | setCurrentItem ( cn ); | 969 | setCurrentItem ( cn ); |
970 | ensureItemVisible ( cn ); | 970 | ensureItemVisible ( cn ); |
971 | } | 971 | } |
972 | } | 972 | } |
973 | } | 973 | } |
974 | e->accept(); | 974 | e->accept(); |
975 | } | 975 | } |
976 | break; | 976 | break; |
977 | case Qt::Key_Return: | 977 | case Qt::Key_Return: |
978 | case Qt::Key_Enter: | 978 | case Qt::Key_Enter: |
979 | { | 979 | { |
980 | QListViewItem* cn; | 980 | QListViewItem* cn; |
981 | cn = currentItem(); | 981 | cn = currentItem(); |
982 | if ( cn ) { | 982 | if ( cn ) { |
983 | KOListViewItem* ci = (KOListViewItem*)( cn ); | 983 | KOListViewItem* ci = (KOListViewItem*)( cn ); |
984 | if ( ci ){ | 984 | if ( ci ){ |
985 | if ( e->state() == ShiftButton ) | 985 | if ( e->state() == ShiftButton ) |
986 | ci->setSelected( false ); | 986 | ci->setSelected( false ); |
987 | else | 987 | else |
988 | ci->setSelected( true ); | 988 | ci->setSelected( true ); |
989 | cn = cn->nextSibling(); | 989 | cn = cn->nextSibling(); |
990 | if ( cn ) { | 990 | if ( cn ) { |
991 | setCurrentItem ( cn ); | 991 | setCurrentItem ( cn ); |
992 | ensureItemVisible ( cn ); | 992 | ensureItemVisible ( cn ); |
993 | } | 993 | } |
994 | } | 994 | } |
995 | } | 995 | } |
996 | e->accept(); | 996 | e->accept(); |
997 | } | 997 | } |
998 | break; | 998 | break; |
999 | default: | 999 | default: |
1000 | e->ignore(); | 1000 | e->ignore(); |
1001 | } | 1001 | } |
1002 | } | 1002 | } |
1003 | KOListViewListView::KOListViewListView(KOListView * lv ) | 1003 | KOListViewListView::KOListViewListView(KOListView * lv ) |
1004 | : KListView( lv ) | 1004 | : KListView( lv ) |
1005 | { | 1005 | { |
1006 | #ifndef DESKTOP_VERSION | 1006 | #ifndef DESKTOP_VERSION |
1007 | QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); | 1007 | QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); |
1008 | #endif | 1008 | #endif |
1009 | mYMousePos = -1000; | ||
1009 | setSelectionMode( QListView::Multi ); | 1010 | setSelectionMode( QListView::Multi ); |
1010 | setMultiSelection( true); | 1011 | setMultiSelection( true); |
1011 | mAllowPopupMenu = true; | 1012 | mAllowPopupMenu = true; |
1012 | mMouseDown = false; | 1013 | mMouseDown = false; |
1013 | 1014 | ||
1014 | } | 1015 | } |
1015 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | 1016 | void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) |
1016 | { | 1017 | { |
1017 | if (!e) return; | 1018 | if (!e) return; |
1018 | QPoint vp = contentsToViewport(e->pos()); | 1019 | QPoint vp = contentsToViewport(e->pos()); |
1019 | QListViewItem *item = itemAt(vp); | 1020 | QListViewItem *item = itemAt(vp); |
1020 | if (!item) { | 1021 | if (!item) { |
1021 | emit newEvent(); | 1022 | emit newEvent(); |
1022 | return; | 1023 | return; |
1023 | } | 1024 | } |
1024 | KListView::contentsMouseDoubleClickEvent(e); | 1025 | KListView::contentsMouseDoubleClickEvent(e); |
1025 | } | 1026 | } |
1026 | 1027 | ||
1027 | 1028 | ||
1028 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) | 1029 | void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) |
1029 | { | 1030 | { |
1030 | //qDebug("contentsMousePressEvent++++ "); | 1031 | //qDebug("contentsMousePressEvent++++ "); |
1031 | if (! mMouseDown ) { | 1032 | if (! mMouseDown ) { |
1032 | mAllowPopupMenu = true; | 1033 | mAllowPopupMenu = true; |
1033 | mYMousePos = mapToGlobal( (e->pos())).y(); | 1034 | mYMousePos = mapToGlobal( (e->pos())).y(); |
1034 | } | 1035 | } |
1035 | if ( e->button() == RightButton && mMouseDown ) | 1036 | if ( e->button() == RightButton && mMouseDown ) |
1036 | return; | 1037 | return; |
1037 | if ( e->button() == LeftButton ) | 1038 | if ( e->button() == LeftButton ) |
1038 | mMouseDown = true; | 1039 | mMouseDown = true; |
1039 | KListView::contentsMousePressEvent( e ); | 1040 | KListView::contentsMousePressEvent( e ); |
1040 | } | 1041 | } |
1041 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) | 1042 | void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e) |
1042 | { | 1043 | { |
1043 | //qDebug("contentsMouseReleaseEv---- "); | 1044 | //qDebug("contentsMouseReleaseEv---- "); |
1044 | if ( ! mMouseDown ) { | 1045 | if ( ! mMouseDown ) { |
1045 | if ( e->button() == RightButton && ! mAllowPopupMenu ) | 1046 | if ( e->button() == RightButton && ! mAllowPopupMenu ) |
1046 | return; | 1047 | return; |
1047 | QListViewItem* ci = currentItem(); | 1048 | QListViewItem* ci = currentItem(); |
1048 | if ( ci ) | 1049 | if ( ci ) |
1049 | ci->setSelected( true ); | 1050 | ci->setSelected( true ); |
1050 | KListView::contentsMouseReleaseEvent(e); | 1051 | KListView::contentsMouseReleaseEvent(e); |
1051 | return; | 1052 | return; |
1052 | } | 1053 | } |
1053 | if ( e->button() == LeftButton ) | 1054 | if ( e->button() == LeftButton ) |
1054 | mMouseDown = false; | 1055 | mMouseDown = false; |
1055 | if ( e->button() == RightButton && ! mAllowPopupMenu ) | 1056 | if ( e->button() == RightButton && ! mAllowPopupMenu ) |
1056 | return; | 1057 | return; |