summaryrefslogtreecommitdiff
path: root/src/gui/widgets/chattab.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-31 00:55:36 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-31 00:55:36 +0300
commitecd8811f15034a6c895a81c0153a4b154dbc1061 (patch)
treec451e027766b6e455033eca468e383de95a81fb0 /src/gui/widgets/chattab.cpp
parentd4f7f4f688c3660440e0ac0d752ec9db036cdf59 (diff)
downloadplus-ecd8811f15034a6c895a81c0153a4b154dbc1061.tar.gz
plus-ecd8811f15034a6c895a81c0153a4b154dbc1061.tar.bz2
plus-ecd8811f15034a6c895a81c0153a4b154dbc1061.tar.xz
plus-ecd8811f15034a6c895a81c0153a4b154dbc1061.zip
Improve chattab class.
Diffstat (limited to 'src/gui/widgets/chattab.cpp')
-rw-r--r--src/gui/widgets/chattab.cpp13
1 files changed, 7 insertions, 6 deletions
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);
}