summaryrefslogtreecommitdiff
path: root/src/gui/sell.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2006-03-19 20:43:10 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2006-03-19 20:43:10 +0000
commit654d24e74c56d240b8d622840c135e22a029636d (patch)
tree5eb8b94f7832bdbb6d21c7ded6e6da6b5f8f3464 /src/gui/sell.cpp
parent3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6 (diff)
downloadmana-client-654d24e74c56d240b8d622840c135e22a029636d.tar.gz
mana-client-654d24e74c56d240b8d622840c135e22a029636d.tar.bz2
mana-client-654d24e74c56d240b8d622840c135e22a029636d.tar.xz
mana-client-654d24e74c56d240b8d622840c135e22a029636d.zip
Unreverted latest change by Doener due to my lack of proper communication abilities.
Diffstat (limited to 'src/gui/sell.cpp')
-rw-r--r--src/gui/sell.cpp18
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