From 00676d2c00f8dbc2806145b9c219c6e4ccbae0c1 Mon Sep 17 00:00:00 2001 From: Marcus Eggenberger Date: Wed, 11 Mar 2009 17:51:21 +0100 Subject: [PATCH] fixes #580 - nick-dropdown is updated even if nickchange fails --- src/qtui/inputwidget.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/qtui/inputwidget.cpp b/src/qtui/inputwidget.cpp index 3c7bec53..d4ca8327 100644 --- a/src/qtui/inputwidget.cpp +++ b/src/qtui/inputwidget.cpp @@ -204,8 +204,11 @@ void InputWidget::updateNickSelector() const { return; IrcUser *me = net->me(); - if(me) - nicks[nickIdx] = net->myNick() + QString(" (+%1)").arg(me->userModes()); + if(me) { + nicks[nickIdx] = net->myNick(); + if(!me->userModes().isEmpty()) + nicks[nickIdx] += QString(" (+%1)").arg(me->userModes()); + } ui.ownNick->addItems(nicks); @@ -219,7 +222,11 @@ void InputWidget::changeNick(const QString &newNick) const { const Network *net = currentNetwork(); if(!net || net->isMyNick(newNick)) return; - emit userInput(currentBufferInfo(), QString("/nick %1").arg(newNick)); + + // we reset the nick selecter as we have no confirmation yet, that this will succeed. + // if the action succeeds it will be properly updated anyways. + updateNickSelector(); + emit userInput(BufferInfo::fakeStatusBuffer(net->networkId()), QString("/nick %1").arg(newNick)); } void InputWidget::sendText(QString text) { -- 2.20.1