summaryrefslogtreecommitdiff
path: root/src/gui/widgets/chattab.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-30 02:10:59 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-30 02:10:59 +0300
commit46f0755975033f37eaae9db73c0e2b6499c2a923 (patch)
tree5c13c361ce4a4e4fd0e07fca1953c54637965666 /src/gui/widgets/chattab.cpp
parent1feb7f7edc5f8f383e594b256ef4cab0fae75b99 (diff)
downloadmanaverse-46f0755975033f37eaae9db73c0e2b6499c2a923.tar.gz
manaverse-46f0755975033f37eaae9db73c0e2b6499c2a923.tar.bz2
manaverse-46f0755975033f37eaae9db73c0e2b6499c2a923.tar.xz
manaverse-46f0755975033f37eaae9db73c0e2b6499c2a923.zip
Add const to more classes.
Diffstat (limited to 'src/gui/widgets/chattab.cpp')
-rw-r--r--src/gui/widgets/chattab.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 0c1bab71a..a78d1f636 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -86,7 +86,7 @@ ChatTab::~ChatTab()
}
void ChatTab::chatLog(std::string line, Own own,
- bool ignoreRecord, bool tryRemoveColors)
+ const bool ignoreRecord, const bool tryRemoveColors)
{
// Trim whitespace
trim(line);
@@ -102,7 +102,7 @@ void ChatTab::chatLog(std::string line, Own own,
return;
}
- unsigned lineLim = config.getIntValue("chatMaxCharLimit");
+ const unsigned lineLim = config.getIntValue("chatMaxCharLimit");
if (lineLim > 0 && line.length() > lineLim)
line = line.substr(0, lineLim);
@@ -220,7 +220,7 @@ void ChatTab::chatLog(std::string line, Own own,
if (config.getBoolValue("useLocalTime"))
{
- struct tm *timeInfo;
+ const struct tm *timeInfo;
timeInfo = localtime(&t);
if (timeInfo)
{
@@ -326,7 +326,7 @@ void ChatTab::chatLog(std::string line, Own own,
void ChatTab::chatLog(const std::string &nick, std::string msg)
{
- Own byWho = (nick == player_node->getName() ? BY_PLAYER : BY_OTHER);
+ const Own byWho = (nick == player_node->getName() ? BY_PLAYER : BY_OTHER);
if (byWho == BY_OTHER && config.getBoolValue("removeColors"))
msg = removeColors(msg);
chatLog(nick + " : " + msg, byWho, false, false);
@@ -395,9 +395,9 @@ void ChatTab::chatInput(const std::string &message)
}
}
-void ChatTab::scroll(int amount)
+void ChatTab::scroll(const int amount)
{
- int range = mScrollArea->getHeight() / 8 * amount;
+ const int range = mScrollArea->getHeight() / 8 * amount;
gcn::Rectangle scr;
scr.y = mScrollArea->getVerticalScrollAmount() + range;
scr.height = abs(range);