diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-07-19 20:22:59 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-07-19 20:22:59 +0200 |
commit | 86eb0c08d233636cd4647649c6542d3cf410e3ab (patch) | |
tree | 9721759b41f0256f15c3786c357448a93215440e /src/gui/chat.cpp | |
parent | 335eec717f6189c01d8217dd2c4f4e74a171d9a5 (diff) | |
parent | 2d584d7e8aaeacbcb1036bae5c8deca9b810fe60 (diff) | |
download | Mana-86eb0c08d233636cd4647649c6542d3cf410e3ab.tar.gz Mana-86eb0c08d233636cd4647649c6542d3cf410e3ab.tar.bz2 Mana-86eb0c08d233636cd4647649c6542d3cf410e3ab.tar.xz Mana-86eb0c08d233636cd4647649c6542d3cf410e3ab.zip |
Merge branch '1.0'
Conflicts:
src/gui/itempopup.cpp
src/item.cpp
src/monster.cpp
src/net/manaserv/playerhandler.cpp
src/net/tmwa/partyhandler.cpp
src/npc.cpp
src/player.cpp
src/resources/itemdb.cpp
src/resources/monsterdb.cpp
src/resources/monsterinfo.cpp
src/resources/npcdb.cpp
src/resources/spritedef.cpp
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r-- | src/gui/chat.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 6ad45fc8..103a2647 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -119,7 +119,7 @@ ChatWindow::~ChatWindow() { config.setValue("ReturnToggles", mReturnToggles); delete mRecorder; - delete_all(mWhispers); + removeAllWhispers(); delete mItemLinkHandler; } @@ -235,10 +235,6 @@ bool ChatWindow::isInputFocused() const void ChatWindow::removeTab(ChatTab *tab) { - // Prevent removal of the local chat tab - if (tab == localChatTab) - return; - mChatTabs->removeTab(tab); } @@ -260,6 +256,25 @@ void ChatWindow::removeWhisper(const std::string &nick) mWhispers.erase(tempNick); } +void ChatWindow::removeAllWhispers() +{ + TabMap::iterator iter; + std::list<ChatTab*> tabs; + + for (iter = mWhispers.begin(); iter != mWhispers.end(); ++iter) + { + tabs.push_back(iter->second); + } + + for (std::list<ChatTab*>::iterator it = tabs.begin(); + it != tabs.end(); ++it) + { + delete *it; + } + + mWhispers.clear(); +} + void ChatWindow::chatInput(const std::string &msg) { ChatTab *tab = getFocused(); |