unbreak command auto-completion (was broken since r0b92341adb6a - 52 commits ago)
authorsheepluva
Mon, 24 Oct 2011 10:59:52 +0200
changeset 6198 9aa9ed77d63c
parent 6197 4ce7c29799b9
child 6199 582e85254110
unbreak command auto-completion (was broken since r0b92341adb6a - 52 commits ago)
QTfrontend/ui/widget/chatwidget.cpp
--- a/QTfrontend/ui/widget/chatwidget.cpp	Mon Oct 24 10:30:47 2011 +0200
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Mon Oct 24 10:59:52 2011 +0200
@@ -251,9 +251,6 @@
     mainLayout.setColumnStretch(1, 24);
 
     chatEditLine = new SmartLineEdit(this);
-    QStringList cmds;
-    cmds << "/me" << "/discardStyleSheet" << "/saveStyleSheet";
-    chatEditLine->addCommands(cmds);
     chatEditLine->setMaxLength(300);
     connect(chatEditLine, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
 
@@ -585,6 +582,12 @@
 void HWChatWidget::clear()
 {
     chatEditLine->reset();
+
+    // add default commands
+    QStringList cmds;
+    cmds << "/me" << "/discardStyleSheet" << "/saveStyleSheet";
+    chatEditLine->addCommands(cmds);
+
     chatText->clear();
     chatStrings.clear();
     chatNicks->clear();