-rw-r--r-- | korganizer/ktimeedit.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/korganizer/ktimeedit.cpp b/korganizer/ktimeedit.cpp index 61a0931..df9b2fc 100644 --- a/korganizer/ktimeedit.cpp +++ b/korganizer/ktimeedit.cpp | |||
@@ -316,60 +316,58 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e) | |||
316 | if ( cpos > 0) { | 316 | if ( cpos > 0) { |
317 | lineEdit()->setCursorPosition(--cpos); | 317 | lineEdit()->setCursorPosition(--cpos); |
318 | setSelect ( cpos , 1 ); | 318 | setSelect ( cpos , 1 ); |
319 | } | 319 | } |
320 | else | 320 | else |
321 | setSelect ( 0 , 1 ); | 321 | setSelect ( 0 , 1 ); |
322 | break; | 322 | break; |
323 | // set cursor to correct place | 323 | // set cursor to correct place |
324 | case Key_Right: | 324 | case Key_Right: |
325 | if ( cpos == 1 ) | 325 | if ( cpos == 1 ) |
326 | ++cpos; | 326 | ++cpos; |
327 | if ( cpos < maxpos ) { | 327 | if ( cpos < maxpos ) { |
328 | lineEdit()->setCursorPosition(++cpos); | 328 | lineEdit()->setCursorPosition(++cpos); |
329 | setSelect ( cpos , 1 ); | 329 | setSelect ( cpos , 1 ); |
330 | } | 330 | } |
331 | break; | 331 | break; |
332 | // rest | 332 | // rest |
333 | case Key_Prior: | 333 | case Key_Prior: |
334 | subTime(QTime(1,0,0)); | 334 | subTime(QTime(1,0,0)); |
335 | break; | 335 | break; |
336 | case Key_Next: | 336 | case Key_Next: |
337 | addTime(QTime(1,0,0)); | 337 | addTime(QTime(1,0,0)); |
338 | break; | 338 | break; |
339 | case Key_Backspace: | 339 | case Key_Backspace: |
340 | qDebug("+++++++++++back "); | ||
341 | if ( cpos > 0) { | 340 | if ( cpos > 0) { |
342 | if ( cpos == 3 ) | 341 | if ( cpos == 3 ) |
343 | --cpos; | 342 | --cpos; |
344 | if ( cpos > 5) | 343 | if ( cpos > 5) |
345 | cpos = 5; | 344 | cpos = 5; |
346 | text.at( cpos-1 ) = '0'; | 345 | text.at( cpos-1 ) = '0'; |
347 | lineEdit()->setText( text ); | 346 | lineEdit()->setText( text ); |
348 | lineEdit()->setCursorPosition(--cpos); | 347 | lineEdit()->setCursorPosition(--cpos); |
349 | setSelect ( cpos , 1 ); | 348 | setSelect ( cpos , 1 ); |
350 | changedText(); | 349 | changedText(); |
351 | qDebug("---------back "); | ||
352 | } | 350 | } |
353 | break; | 351 | break; |
354 | } // switch arrows | 352 | } // switch arrows |
355 | 353 | ||
356 | // if cursor at string end, alltext market and keyEvent don't ArrowLeft -> deselect and cpos | 354 | // if cursor at string end, alltext market and keyEvent don't ArrowLeft -> deselect and cpos |
357 | if( cpos > 4 && lineEdit()->markedText().length() == 5 && e->key() != Key_Left ) { | 355 | if( cpos > 4 && lineEdit()->markedText().length() == 5 && e->key() != Key_Left ) { |
358 | lineEdit()->deselect(); | 356 | lineEdit()->deselect(); |
359 | cpos = 0; | 357 | cpos = 0; |
360 | lineEdit()->setCursorPosition(cpos); | 358 | lineEdit()->setCursorPosition(cpos); |
361 | setSelect(cpos , 1); | 359 | setSelect(cpos , 1); |
362 | } | 360 | } |
363 | 361 | ||
364 | if ( cpos == 2 ) { | 362 | if ( cpos == 2 ) { |
365 | lineEdit()->setCursorPosition(++cpos); | 363 | lineEdit()->setCursorPosition(++cpos); |
366 | } | 364 | } |
367 | 365 | ||
368 | // num keys when cursorPos preEnd | 366 | // num keys when cursorPos preEnd |
369 | if ( cpos < 5 ) { | 367 | if ( cpos < 5 ) { |
370 | // switch another keys | 368 | // switch another keys |
371 | switch(e->key()) { | 369 | switch(e->key()) { |
372 | case Key_Delete: | 370 | case Key_Delete: |
373 | text.at( cpos ) = '0'; | 371 | text.at( cpos ) = '0'; |
374 | lineEdit()->setText( text ); | 372 | lineEdit()->setText( text ); |
375 | lineEdit()->setCursorPosition(cpos); | 373 | lineEdit()->setCursorPosition(cpos); |