Fix #984 without breaking topic input
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 22 Jan 2012 20:12:13 +0000 (21:12 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 22 Jan 2012 20:12:13 +0000 (21:12 +0100)
Queued connection ensures that the textEdit is already reset() when InputWidget
does its thing, thus solving the history issues.

Approved by Tucos reading it 10 times. :>

src/qtui/inputwidget.cpp
src/qtui/inputwidget.h

index 340f9e5..d325578 100644 (file)
@@ -132,6 +132,7 @@ InputWidget::InputWidget(QWidget *parent)
   activateInputline->setText(tr("Focus Input Line"));
   activateInputline->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
 
   activateInputline->setText(tr("Focus Input Line"));
   activateInputline->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_L));
 
+  connect(inputLine(), SIGNAL(textEntered(QString)), SLOT(onTextEntered(QString)), Qt::QueuedConnection); // make sure the line is already reset, bug #984
   connect(inputLine(), SIGNAL(currentCharFormatChanged(QTextCharFormat)), this, SLOT(currentCharFormatChanged(QTextCharFormat)));
 }
 
   connect(inputLine(), SIGNAL(currentCharFormatChanged(QTextCharFormat)), this, SLOT(currentCharFormatChanged(QTextCharFormat)));
 }
 
@@ -413,7 +414,7 @@ void InputWidget::changeNick(const QString &newNick) const {
   Client::userInput(BufferInfo::fakeStatusBuffer(net->networkId()), QString("/NICK %1").arg(newNick));
 }
 
   Client::userInput(BufferInfo::fakeStatusBuffer(net->networkId()), QString("/NICK %1").arg(newNick));
 }
 
-void InputWidget::on_inputEdit_textEntered(const QString &text) {
+void InputWidget::onTextEntered(const QString &text) {
   Client::userInput(currentBufferInfo(), text);
   ui.boldButton->setChecked(false);
   ui.underlineButton->setChecked(false);
   Client::userInput(currentBufferInfo(), text);
   ui.boldButton->setChecked(false);
   ui.underlineButton->setChecked(false);
index b577035..38981fd 100644 (file)
@@ -62,7 +62,7 @@ private slots:
   void setMaxLines(const QVariant &);
   void setMultiLineEnabled(const QVariant &);
   void setScrollBarsEnabled(const QVariant &);
   void setMaxLines(const QVariant &);
   void setMultiLineEnabled(const QVariant &);
   void setScrollBarsEnabled(const QVariant &);
-  void on_inputEdit_textEntered(const QString &text);
+  void onTextEntered(const QString &text);
   void changeNick(const QString &newNick) const;
 
   void setNetwork(NetworkId networkId);
   void changeNick(const QString &newNick) const;
 
   void setNetwork(NetworkId networkId);