summaryrefslogtreecommitdiff
path: root/src/gui/shopwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-26 00:01:56 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-26 00:01:56 +0300
commit803b6afd00b0e3574b40b866f21a0d3d01f6dc4d (patch)
tree8a55ef881f1eaac4d216b3f5d2c4605eb520070d /src/gui/shopwindow.cpp
parent8478d540748edccf36dc9bda5f0c3de0aa7bf763 (diff)
downloadmanaplus-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/shopwindow.cpp')
-rw-r--r--src/gui/shopwindow.cpp44
1 files changed, 21 insertions, 23 deletions
diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp
index dfecdbbe5..d42583f62 100644
--- a/src/gui/shopwindow.cpp
+++ b/src/gui/shopwindow.cpp
@@ -440,9 +440,9 @@ void ShopWindow::announce(ShopItems *const list, const int mode)
std::string data = "\302\202";
if (mode == BUY)
- data += "Buy ";
+ data.append("Buy ");
else
- data += "Sell ";
+ data.append("Sell ");
if (mAnnonceTime && (mAnnonceTime + (2 * 60) > cur_time
|| mAnnonceTime > cur_time))
@@ -465,30 +465,28 @@ void ShopWindow::announce(ShopItems *const list, const int mode)
{
if (mAnnounceLinks->isSelected())
{
- data += strprintf("[@@%d|%s@@] (%dGP) %d, ", item->getId(),
- item->getInfo().getName().c_str(),
- item->getPrice(), item->getQuantity());
+ data.append(strprintf("[@@%d|%s@@] (%dGP) %d, ", item->getId(),
+ item->getInfo().getName().c_str(),
+ item->getPrice(), item->getQuantity()));
}
else
{
- data += strprintf("%s (%dGP) %d, ",
- item->getInfo().getName().c_str(),
- item->getPrice(), item->getQuantity());
+ data.append(strprintf("%s (%dGP) %d, ",
+ item->getInfo().getName().c_str(),
+ item->getPrice(), item->getQuantity()));
}
}
else
{
if (mAnnounceLinks->isSelected())
{
- data += strprintf("[@@%d|%s@@] (%dGP), ", item->getId(),
- item->getInfo().getName().c_str(),
- item->getPrice());
+ data.append(strprintf("[@@%d|%s@@] (%dGP), ", item->getId(),
+ item->getInfo().getName().c_str(), item->getPrice()));
}
else
{
- data += strprintf("%s (%dGP), ",
- item->getInfo().getName().c_str(),
- item->getPrice());
+ data.append(strprintf("%s (%dGP), ",
+ item->getInfo().getName().c_str(), item->getPrice()));
}
}
}
@@ -507,12 +505,12 @@ void ShopWindow::giveList(const std::string &nick, const int mode)
if (mode == BUY)
{
list = mBuyShopItems;
- data += "S1";
+ data.append("S1");
}
else
{
list = mSellShopItems;
- data += "B1";
+ data.append("B1");
}
if (!list)
return;
@@ -541,10 +539,10 @@ void ShopWindow::giveList(const std::string &nick, const int mode)
if (amount)
{
- data += strprintf("%s%s%s",
+ data.append(strprintf("%s%s%s",
encodeStr(item->getId(), 2).c_str(),
encodeStr(item->getPrice(), 4).c_str(),
- encodeStr(amount, 3).c_str());
+ encodeStr(amount, 3).c_str()));
}
}
}
@@ -560,10 +558,10 @@ void ShopWindow::giveList(const std::string &nick, const int mode)
if (amount > 0)
{
- data += strprintf("%s%s%s",
- encodeStr(item->getId(), 2).c_str(),
- encodeStr(item->getPrice(), 4).c_str(),
- encodeStr(amount, 3).c_str());
+ data.append(strprintf("%s%s%s",
+ encodeStr(item->getId(), 2).c_str(),
+ encodeStr(item->getPrice(), 4).c_str(),
+ encodeStr(amount, 3).c_str()));
}
}
}
@@ -581,7 +579,7 @@ void ShopWindow::sendMessage(const std::string &nick,
mRandCounter ++;
if (mRandCounter > 200)
mRandCounter = 0;
- data += encodeStr(mRandCounter, 2);
+ data.append(encodeStr(mRandCounter, 2));
}
if (config.getBoolValue("hideShopMessages"))