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/whoisonline.cpp | |
parent | 8478d540748edccf36dc9bda5f0c3de0aa7bf763 (diff) | |
download | mv-803b6afd00b0e3574b40b866f21a0d3d01f6dc4d.tar.gz mv-803b6afd00b0e3574b40b866f21a0d3d01f6dc4d.tar.bz2 mv-803b6afd00b0e3574b40b866f21a0d3d01f6dc4d.tar.xz mv-803b6afd00b0e3574b40b866f21a0d3d01f6dc4d.zip |
Improve string usage in other files.
Diffstat (limited to 'src/gui/whoisonline.cpp')
-rw-r--r-- | src/gui/whoisonline.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp index 3a03eec13..a1058928d 100644 --- a/src/gui/whoisonline.cpp +++ b/src/gui/whoisonline.cpp @@ -156,9 +156,14 @@ void WhoIsOnline::handleLink(const std::string& link, gcn::MouseEvent *event) { std::string text = decodeLinkText(link); if (config.getBoolValue("whispertab")) + { chatWindow->localChatInput("/q " + text); + } else - chatWindow->addInputText("/w \"" + text + "\" "); + { + chatWindow->addInputText(std::string("/w \"").append( + text).append("\" ")); + } } } else if (event->getButton() == gcn::MouseEvent::RIGHT) @@ -805,29 +810,29 @@ void OnlinePlayer::setText(std::string color) } if ((mStatus != 255 && mStatus & Being::FLAG_GM) || mIsGM) - mText += "(GM) "; + mText.append("(GM) "); if (mLevel > 0) - mText += strprintf("%d", mLevel); + mText.append(strprintf("%d", mLevel)); if (mGender == GENDER_FEMALE) - mText += "\u2640"; + mText.append("\u2640"); else if (mGender == GENDER_MALE) - mText += "\u2642"; + mText.append("\u2642"); if (mStatus > 0 && mStatus != 255) { if (mStatus & Being::FLAG_SHOP) - mText += "$"; + mText.append("$"); if (mStatus & Being::FLAG_AWAY) { // TRANSLATORS: this away status writed in player nick - mText += _("A"); + mText.append(_("A")); } if (mStatus & Being::FLAG_INACTIVE) { // TRANSLATORS: this inactive status writed in player nick - mText += _("I"); + mText.append(_("I")); } if (mStatus & Being::FLAG_GM && color == "0") @@ -839,7 +844,7 @@ void OnlinePlayer::setText(std::string color) } if (mVersion > 0) - mText += strprintf(" - %d", mVersion); + mText.append(strprintf(" - %d", mVersion)); const char *const text = encodeLinkText(mNick).c_str(); mText = strprintf("@@%s|##%s%s %s@@", text, color.c_str(), |