summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Iacovitti <aiacovitti@libero.it>2011-08-04 14:54:25 (GMT)
committerAndrea Iacovitti <aiacovitti@libero.it>2011-08-04 15:24:02 (GMT)
commit0f9004209464f2bdfbef9031836ed72c63f52887 (patch)
tree3b8ab6aaeea5dccc7f30a435089427d18cddacb6
parentf1e3aecc8244f6cdc77d9e0d61ac28eb007c8b32 (diff)
Restore klineedit behavior as before kdelibs commit 2ea274cd.
Fixed khtml form regression where choosing an item in completion box by pressing Enter key immediately submits the form instead of just filling the input text field. BUG: 277943 FIXED-IN: 4.7.1
-rw-r--r--kdeui/widgets/klineedit.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/kdeui/widgets/klineedit.cpp b/kdeui/widgets/klineedit.cpp
index 8f1c8a4..4b8835b 100644
--- a/kdeui/widgets/klineedit.cpp
+++ b/kdeui/widgets/klineedit.cpp
@@ -803,18 +803,21 @@ void KLineEdit::keyPressEvent( QKeyEvent *e )
(e->modifiers() == Qt::NoButton ||
e->modifiers() == Qt::KeypadModifier)));
+ if (stopEvent) {
+ emit QLineEdit::returnPressed();
+ e->accept();
+ }
+
+ emit returnPressed( displayText() );
+
if (trap) {
d->completionBox->hide();
deselect();
setCursorPosition(text().length());
}
- emit returnPressed( displayText() );
-
// Eat the event if the user asked for it, or if a completionbox was visible
if (stopEvent) {
- emit QLineEdit::returnPressed();
- e->accept();
return;
}
}