summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/komonthview.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index d825493..940d288 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -124,6 +124,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
124 e->ignore(); 124 e->ignore();
125 break; 125 break;
126 } 126 }
127 if ( count() ) {
127 setCurrentItem((currentItem()+count()-1)%count()); 128 setCurrentItem((currentItem()+count()-1)%count());
128 if(!itemVisible(currentItem())) { 129 if(!itemVisible(currentItem())) {
129 if((unsigned int) currentItem() == (count()-1)) { 130 if((unsigned int) currentItem() == (count()-1)) {
@@ -132,12 +133,14 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
132 setTopItem(topItem()-1); 133 setTopItem(topItem()-1);
133 } 134 }
134 } 135 }
136 }
135 break; 137 break;
136 case Key_Down: 138 case Key_Down:
137 if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) { 139 if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
138 e->ignore(); 140 e->ignore();
139 break; 141 break;
140 } 142 }
143 if ( count () ) {
141 setCurrentItem((currentItem()+1)%count()); 144 setCurrentItem((currentItem()+1)%count());
142 if(!itemVisible(currentItem())) { 145 if(!itemVisible(currentItem())) {
143 if(currentItem() == 0) { 146 if(currentItem() == 0) {
@@ -146,6 +149,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
146 setTopItem(topItem()+1); 149 setTopItem(topItem()+1);
147 } 150 }
148 } 151 }
152 }
149 break; 153 break;
150 case Key_I: 154 case Key_I:
151 QTimer::singleShot( 11, this, SLOT ( oneDown() ) ); 155 QTimer::singleShot( 11, this, SLOT ( oneDown() ) );
@@ -162,6 +166,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
162 166
163void KNoScrollListBox::oneDown() 167void KNoScrollListBox::oneDown()
164{ 168{
169 if ( count () ) {
165 setCurrentItem((currentItem()+1)%count()); 170 setCurrentItem((currentItem()+1)%count());
166 if(!itemVisible(currentItem())) { 171 if(!itemVisible(currentItem())) {
167 if(currentItem() == 0) { 172 if(currentItem() == 0) {
@@ -171,6 +176,7 @@ void KNoScrollListBox::oneDown()
171 } 176 }
172 } 177 }
173} 178}
179}
174void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) 180void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e)
175{ 181{
176 switch(e->key()) { 182 switch(e->key()) {