From 46f0755975033f37eaae9db73c0e2b6499c2a923 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 30 Aug 2012 02:10:59 +0300 Subject: Add const to more classes. --- src/gui/widgets/chattab.cpp | 12 ++++++------ 1 file changed, 6 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 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); -- cgit v1.2.3-60-g2f50