From ecd8811f15034a6c895a81c0153a4b154dbc1061 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 31 May 2013 00:55:36 +0300 Subject: Improve chattab class. --- src/gui/widgets/chattab.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/gui/widgets/chattab.cpp') diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index 339d124f7..df84368f9 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -281,10 +281,11 @@ void ChatTab::chatLog(std::string line, Own own, return; } - if (!getTabbedArea()) + TabbedArea *const tabArea = getTabbedArea(); + if (!tabArea) return; - if (this != getTabbedArea()->getSelectedTab()) + if (this != tabArea->getSelectedTab()) { if (getFlash() == 0) { @@ -306,7 +307,7 @@ void ChatTab::chatLog(std::string line, Own own, } if ((getAllowHighlight() || own == BY_GM) - && (this != getTabbedArea()->getSelectedTab() + && (this != tabArea->getSelectedTab() || (Client::getIsMinimized() || (!Client::getMouseFocused() && !Client::getInputFocused())))) { @@ -443,7 +444,7 @@ bool ChatTab::handleCommands(const std::string &type, const std::string &args) return handleCommand(type, args); } -void ChatTab::saveToLogFile(std::string &msg) +void ChatTab::saveToLogFile(const std::string &msg) { if (getType() == TAB_INPUT && chatLogger) chatLogger->log(msg); @@ -480,7 +481,7 @@ void ChatTab::addRow(std::string &line) mTextOutput->addRow(line); } -void ChatTab::loadFromLogFile(std::string name) +void ChatTab::loadFromLogFile(const std::string &name) { if (chatLogger) { @@ -512,7 +513,7 @@ void ChatTab::addNewRow(std::string &line) mScrollArea->logic(); } -void ChatTab::playNewMessageSound() +void ChatTab::playNewMessageSound() const { soundManager.playGuiSound(SOUND_WHISPER); } -- cgit v1.2.3-70-g09d2