summaryrefslogtreecommitdiffabout
path: root/korganizer/ktimeedit.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/ktimeedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/ktimeedit.cpp2
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
@@ -292,108 +292,106 @@ void KOTimeEdit::keyPressEvent(QKeyEvent *e)
setSelect ( 5 , 2 );
break;
}
case 4:
subTime(QTime(0,1,0), false );
setSelect ( cpos , 1 );
break;
case 3:
subTime(QTime(0,10,0), false );
setSelect ( cpos , 1 );
break;
case 2:
lineEdit()->setCursorPosition(--cpos);
case 1:
case 0:
subTime(QTime(1,0,0), false );
setSelect ( 0 , 2 );
break;
}
break;
// set cursor to correct place
case Key_Left:
if ( cpos == 3 )
--cpos;
if ( cpos > 0) {
lineEdit()->setCursorPosition(--cpos);
setSelect ( cpos , 1 );
}
else
setSelect ( 0 , 1 );
break;
// set cursor to correct place
case Key_Right:
if ( cpos == 1 )
++cpos;
if ( cpos < maxpos ) {
lineEdit()->setCursorPosition(++cpos);
setSelect ( cpos , 1 );
}
break;
// rest
case Key_Prior:
subTime(QTime(1,0,0));
break;
case Key_Next:
addTime(QTime(1,0,0));
break;
case Key_Backspace:
- qDebug("+++++++++++back ");
if ( cpos > 0) {
if ( cpos == 3 )
--cpos;
if ( cpos > 5)
cpos = 5;
text.at( cpos-1 ) = '0';
lineEdit()->setText( text );
lineEdit()->setCursorPosition(--cpos);
setSelect ( cpos , 1 );
changedText();
- qDebug("---------back ");
}
break;
} // switch arrows
// if cursor at string end, alltext market and keyEvent don't ArrowLeft -> deselect and cpos
if( cpos > 4 && lineEdit()->markedText().length() == 5 && e->key() != Key_Left ) {
lineEdit()->deselect();
cpos = 0;
lineEdit()->setCursorPosition(cpos);
setSelect(cpos , 1);
}
if ( cpos == 2 ) {
lineEdit()->setCursorPosition(++cpos);
}
// num keys when cursorPos preEnd
if ( cpos < 5 ) {
// switch another keys
switch(e->key()) {
case Key_Delete:
text.at( cpos ) = '0';
lineEdit()->setText( text );
lineEdit()->setCursorPosition(cpos);
setSelect ( cpos , 1 );
changedText();
break;
case Key_9:
case Key_8:
case Key_7:
case Key_6:
if ( !(cpos == 1 || cpos == 4) )
return;
if ( cpos == 1 && text.at( 0 ) > '1')
text.at( 0 ) = '1';
case Key_5:
case Key_4:
case Key_3:
if ( cpos < 1 )
return;
if ( hour12Format && cpos == 1 )
return;
case Key_2:
if ( hour12Format && cpos == 0 )
return;
if ( cpos == 0 && text.at( 1 ) > '3')
text.at( 1 ) = '3';
case Key_1: