summaryrefslogtreecommitdiff
path: root/extra/kdelibs/fix-lineedit-completion-tab.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extra/kdelibs/fix-lineedit-completion-tab.patch')
-rw-r--r--extra/kdelibs/fix-lineedit-completion-tab.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/extra/kdelibs/fix-lineedit-completion-tab.patch b/extra/kdelibs/fix-lineedit-completion-tab.patch
new file mode 100644
index 000000000..0c88dffc9
--- /dev/null
+++ b/extra/kdelibs/fix-lineedit-completion-tab.patch
@@ -0,0 +1,56 @@
+--- kdelibs/khtml/rendering/render_form.cpp
++++ kdelibs/khtml/rendering/render_form.cpp
+@@ -1012,11 +1012,11 @@
+ // -----------------------------------------------------------------------------
+
+ RenderLineEdit::RenderLineEdit(HTMLInputElementImpl *element)
+- : RenderFormElement(element)
++ : RenderFormElement(element), m_blockElementUpdates(false)
+ {
+ LineEditWidget *edit = new LineEditWidget(element, view(), view()->widget());
+ connect(edit,SIGNAL(returnPressed()), this, SLOT(slotReturnPressed()));
+- connect(edit,SIGNAL(textEdited(QString)),this,SLOT(slotTextEdited(QString)));
++ connect(edit,SIGNAL(textChanged(QString)),this,SLOT(slotTextChanged(QString)));
+
+ if(element->inputType() == HTMLInputElementImpl::PASSWORD)
+ edit->setEchoMode( QLineEdit::Password );
+@@ -1142,17 +1142,21 @@
+ }
+
+ if (element()->value().string() != widget()->text()) {
++ m_blockElementUpdates = true;
+ int pos = widget()->cursorPosition();
+ widget()->setText(element()->value().string());
+ widget()->setCursorPosition(pos);
++ m_blockElementUpdates = false;
+ }
+ widget()->setReadOnly(element()->readOnly());
+
+ RenderFormElement::updateFromElement();
+ }
+
+-void RenderLineEdit::slotTextEdited(const QString &string)
++void RenderLineEdit::slotTextChanged(const QString &string)
+ {
++ if (m_blockElementUpdates) return;
++
+ // don't use setValue here!
+ element()->m_value = string;
+ element()->m_unsubmittedFormChange = true;
+--- kdelibs/khtml/rendering/render_form.h
++++ kdelibs/khtml/rendering/render_form.h
+@@ -282,12 +282,13 @@
+ void setSelectionRange(long start, long end);
+ public Q_SLOTS:
+ void slotReturnPressed();
+- void slotTextEdited(const QString &string);
++ void slotTextChanged(const QString &string);
+ protected:
+
+ private:
+ virtual bool isEditable() const { return true; }
+ virtual bool canHaveBorder() const { return true; }
++ bool m_blockElementUpdates;
+ };
+
+ // -------------------------------------------------------------------------