From 6ce49efadfadd8eacb048df274979736bb04daf0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 24 Feb 2013 22:59:54 +0300 Subject: Improve string usage in some files. --- src/shopitem.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/shopitem.cpp') diff --git a/src/shopitem.cpp b/src/shopitem.cpp index d0a3cce4d..831b8cd43 100644 --- a/src/shopitem.cpp +++ b/src/shopitem.cpp @@ -38,16 +38,16 @@ ShopItem::ShopItem(const int inventoryIndex, const int id, { if (serverVersion > 0) { - mDisplayName = getInfo().getName(color) + " (" - + Units::formatCurrency(mPrice).c_str() + ") "; + mDisplayName = std::string(getInfo().getName(color)).append(" (") + .append(Units::formatCurrency(mPrice)).append(") "); } else { - mDisplayName = getInfo().getName() + " (" - + Units::formatCurrency(mPrice).c_str() + ") "; + mDisplayName = std::string(getInfo().getName()).append(" (") + .append(Units::formatCurrency(mPrice)).append(") "); } if (quantity > 0) - mDisplayName += "[" + toString(quantity) + "]"; + mDisplayName.append("[").append(toString(quantity)).append("]"); setInvIndex(inventoryIndex); addDuplicate(inventoryIndex, quantity); @@ -60,13 +60,13 @@ ShopItem::ShopItem (const int id, const unsigned char color, const int price) : { if (serverVersion > 0) { - mDisplayName = getInfo().getName(color) + - " (" + Units::formatCurrency(mPrice).c_str() + ")"; + mDisplayName = std::string(getInfo().getName(color)).append(" (") + .append(Units::formatCurrency(mPrice)).append(")"); } else { - mDisplayName = getInfo().getName() + - " (" + Units::formatCurrency(mPrice).c_str() + ")"; + mDisplayName = std::string(getInfo().getName()).append(" (") + .append(Units::formatCurrency(mPrice)).append(")"); } setInvIndex(-1); addDuplicate(-1, 0); @@ -88,16 +88,16 @@ void ShopItem::update() { if (serverVersion > 0) { - mDisplayName = getInfo().getName(mColor) + " (" - + Units::formatCurrency(mPrice).c_str() + ") "; + mDisplayName = std::string(getInfo().getName(mColor)).append(" (") + .append(Units::formatCurrency(mPrice)).append(") "); } else { - mDisplayName = getInfo().getName() + " (" - + Units::formatCurrency(mPrice).c_str() + ") "; + mDisplayName = std::string(getInfo().getName()).append(" (") + .append(Units::formatCurrency(mPrice)).append(") "); } if (mQuantity > 0) - mDisplayName += "[" + toString(mQuantity) + "]"; + mDisplayName.append("[").append(toString(mQuantity)).append("]"); } } -- cgit v1.2.3-60-g2f50