author | zautrix <zautrix> | 2005-03-29 00:10:48 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-29 00:10:48 (UTC) |
commit | a5d52c19d2cd9b008e5cf41d5c7d2c193df7ee46 (patch) (unidiff) | |
tree | b9f1b2710da1cd0105382831ac0a3e3d7d44f09c | |
parent | 4e7c45695672ecdbd0cd14cac0ea29a8e134ee78 (diff) | |
download | kdepimpi-a5d52c19d2cd9b008e5cf41d5c7d2c193df7ee46.zip kdepimpi-a5d52c19d2cd9b008e5cf41d5c7d2c193df7ee46.tar.gz kdepimpi-a5d52c19d2cd9b008e5cf41d5c7d2c193df7ee46.tar.bz2 |
fix
-rw-r--r-- | korganizer/komonthview.cpp | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index d825493..940d288 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -124,12 +124,14 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
124 | e->ignore(); | 124 | e->ignore(); |
125 | break; | 125 | break; |
126 | } | 126 | } |
127 | setCurrentItem((currentItem()+count()-1)%count()); | 127 | if ( count() ) { |
128 | if(!itemVisible(currentItem())) { | 128 | setCurrentItem((currentItem()+count()-1)%count()); |
129 | if((unsigned int) currentItem() == (count()-1)) { | 129 | if(!itemVisible(currentItem())) { |
130 | setTopItem(currentItem()-numItemsVisible()+1); | 130 | if((unsigned int) currentItem() == (count()-1)) { |
131 | } else { | 131 | setTopItem(currentItem()-numItemsVisible()+1); |
132 | setTopItem(topItem()-1); | 132 | } else { |
133 | setTopItem(topItem()-1); | ||
134 | } | ||
133 | } | 135 | } |
134 | } | 136 | } |
135 | break; | 137 | break; |
@@ -138,12 +140,14 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
138 | e->ignore(); | 140 | e->ignore(); |
139 | break; | 141 | break; |
140 | } | 142 | } |
141 | setCurrentItem((currentItem()+1)%count()); | 143 | if ( count () ) { |
142 | if(!itemVisible(currentItem())) { | 144 | setCurrentItem((currentItem()+1)%count()); |
143 | if(currentItem() == 0) { | 145 | if(!itemVisible(currentItem())) { |
144 | setTopItem(0); | 146 | if(currentItem() == 0) { |
145 | } else { | 147 | setTopItem(0); |
146 | setTopItem(topItem()+1); | 148 | } else { |
149 | setTopItem(topItem()+1); | ||
150 | } | ||
147 | } | 151 | } |
148 | } | 152 | } |
149 | break; | 153 | break; |
@@ -162,12 +166,14 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e) | |||
162 | 166 | ||
163 | void KNoScrollListBox::oneDown() | 167 | void KNoScrollListBox::oneDown() |
164 | { | 168 | { |
165 | setCurrentItem((currentItem()+1)%count()); | 169 | if ( count () ) { |
166 | if(!itemVisible(currentItem())) { | 170 | setCurrentItem((currentItem()+1)%count()); |
167 | if(currentItem() == 0) { | 171 | if(!itemVisible(currentItem())) { |
168 | setTopItem(0); | 172 | if(currentItem() == 0) { |
169 | } else { | 173 | setTopItem(0); |
170 | setTopItem(topItem()+1); | 174 | } else { |
175 | setTopItem(topItem()+1); | ||
176 | } | ||
171 | } | 177 | } |
172 | } | 178 | } |
173 | } | 179 | } |