diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-18 14:47:14 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-18 14:47:14 +0000 |
commit | ab678324e3d73e2354cef331624ecef7cfc03203 (patch) | |
tree | 29394a5aca6e59f817f7cfa3b9281891a273d259 /src/gui/sell.cpp | |
parent | 32badd4b6f843cb74fdc3238fe92119518c8c0ab (diff) | |
download | mana-client-ab678324e3d73e2354cef331624ecef7cfc03203.tar.gz mana-client-ab678324e3d73e2354cef331624ecef7cfc03203.tar.bz2 mana-client-ab678324e3d73e2354cef331624ecef7cfc03203.tar.xz mana-client-ab678324e3d73e2354cef331624ecef7cfc03203.zip |
Added a toString conversion function.
Diffstat (limited to 'src/gui/sell.cpp')
-rw-r--r-- | src/gui/sell.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index aa67adab..bde8906b 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -24,7 +24,6 @@ #include "sell.h" #include <cassert> -#include <sstream> #include <guichan/widgets/label.hpp> @@ -43,6 +42,7 @@ #include "../net/messageout.h" #include "../net/protocol.h" +#include "../utils/tostring.h" SellDialog::SellDialog(Network *network): Window("Sell"), @@ -141,11 +141,8 @@ void SellDialog::addItem(Item *item, int price) return; ITEM_SHOP item_shop; - std::stringstream ss; - ss << item->getInfo()->getName() << " " << price << " GP"; - - item_shop.name = ss.str(); + item_shop.name = item->getInfo()->getName() + " " + toString(price) + " GP"; item_shop.price = price; item_shop.index = item->getInvIndex(); item_shop.id = item->getId(); @@ -240,15 +237,12 @@ void SellDialog::action(const std::string& eventId) // If anything changed, we need to update the buttons and labels if (updateButtonsAndLabels) { - std::stringstream oss; - // Update labels - oss << mAmountItems; - mQuantityLabel->setCaption(oss.str()); + mQuantityLabel->setCaption(toString(mAmountItems)); mQuantityLabel->adjustSize(); - oss.str(""); - oss << "Price: " << mAmountItems * mShopItems->at(selectedItem).price; - mMoneyLabel->setCaption(oss.str()); + + int price = mAmountItems * mShopItems->at(selectedItem).price; + mMoneyLabel->setCaption("Price: " + toString(price)); mMoneyLabel->adjustSize(); // Update Buttons |