diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-02-26 00:01:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-02-26 00:01:56 +0300 |
commit | 803b6afd00b0e3574b40b866f21a0d3d01f6dc4d (patch) | |
tree | 8a55ef881f1eaac4d216b3f5d2c4605eb520070d /src/gui/chatwindow.cpp | |
parent | 8478d540748edccf36dc9bda5f0c3de0aa7bf763 (diff) | |
download | manaplus-803b6afd00b0e3574b40b866f21a0d3d01f6dc4d.tar.gz manaplus-803b6afd00b0e3574b40b866f21a0d3d01f6dc4d.tar.bz2 manaplus-803b6afd00b0e3574b40b866f21a0d3d01f6dc4d.tar.xz manaplus-803b6afd00b0e3574b40b866f21a0d3d01f6dc4d.zip |
Improve string usage in other files.
Diffstat (limited to 'src/gui/chatwindow.cpp')
-rw-r--r-- | src/gui/chatwindow.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 78ffde880..12b4ee17b 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -702,8 +702,8 @@ void ChatWindow::doPresent() const if ((*it)->getType() == ActorSprite::PLAYER) { if (!response.empty()) - response += ", "; - response += static_cast<Being*>(*it)->getName(); + response.append(", "); + response.append(static_cast<Being*>(*it)->getName()); ++playercount; } } @@ -978,12 +978,15 @@ void ChatWindow::processEvent(Channels channel, const DepricatedEvent &event) - event.getInt("oldValue"); if (change != 0) - battleChatLog("+" + toString(change) + " xp"); + { + battleChatLog(std::string("+").append(toString( + change)).append(" xp")); + } break; } case PlayerInfo::LEVEL: - battleChatLog("Level: " + toString( - event.getInt("newValue"))); + battleChatLog(std::string("Level: ").append(toString( + event.getInt("newValue")))); break; default: break; @@ -1007,7 +1010,10 @@ void ChatWindow::processEvent(Channels channel, const DepricatedEvent &event) const int change = exp.first - event.getInt("oldValue1"); if (change != 0) - battleChatLog("+" + toString(change) + " job"); + { + battleChatLog(std::string("+").append( + toString(change)).append(" job")); + } } } } @@ -1131,7 +1137,8 @@ void ChatWindow::addWhisper(const std::string &nick, } else { - localChatTab->chatLog(nick + " : " + mes, ACT_WHISPER, false); + localChatTab->chatLog(std::string(nick).append( + " : ").append(mes), ACT_WHISPER, false); if (player_node) player_node->afkRespond(nullptr, nick); } @@ -1246,7 +1253,7 @@ std::string ChatWindow::addColors(std::string &msg) } // simple colors - return "##" + toString(mChatColor - 1) + msg; + return std::string("##").append(toString(mChatColor - 1)).append(msg); } void ChatWindow::autoComplete() @@ -1309,8 +1316,9 @@ void ChatWindow::autoComplete() { newName = "_" + newName; } - mChatInput->setText(inputText.substr(0, startName) + newName - + inputText.substr(caretPos, inputText.length() - caretPos)); + mChatInput->setText(inputText.substr(0, startName).append(newName) + .append(inputText.substr(caretPos, + inputText.length() - caretPos))); const int len = caretPos - static_cast<int>(name.length()) + static_cast<int>(newName.length()); |