summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/selldialog.cpp12
-rw-r--r--src/gui/selldialog.h2
2 files changed, 5 insertions, 9 deletions
diff --git a/src/gui/selldialog.cpp b/src/gui/selldialog.cpp
index 82d79104a..8006355bc 100644
--- a/src/gui/selldialog.cpp
+++ b/src/gui/selldialog.cpp
@@ -151,7 +151,6 @@ SellDialog::~SellDialog()
{
delete mShopItems;
mShopItems = nullptr;
-
instances.remove(this);
}
@@ -159,10 +158,7 @@ void SellDialog::reset()
{
mShopItems->clear();
mSlider->setValue(0);
-
- // Reset previous selected item to prevent failing asserts
mShopItemList->setSelected(-1);
-
updateButtonsAndLabels();
}
@@ -234,12 +230,13 @@ void SellDialog::action(const gcn::ActionEvent &event)
{
if (eventId == "presell")
{
- ShopItem *const item = mShopItems->at(selectedItem);
+ const ShopItem *const item = mShopItems->at(selectedItem);
const ItemInfo &info = ItemDB::get(item->getId());
if (info.isProtected())
{
- // TRANSLATORS: sell confirmation header
- ConfirmDialog *dialog = new ConfirmDialog(_("sell item"),
+ ConfirmDialog *const dialog = new ConfirmDialog(
+ // TRANSLATORS: sell confirmation header
+ _("sell item"),
// TRANSLATORS: sell confirmation message
strprintf(_("Do you really want to sell %s?"),
info.getName().c_str()), false, true);
@@ -292,7 +289,6 @@ void SellDialog::action(const gcn::ActionEvent &event)
else
{
ShopItem *const item = mShopItems->at(selectedItem);
-
Net::getBuySellHandler()->sendSellRequest(mNick,
item, mAmountItems);
diff --git a/src/gui/selldialog.h b/src/gui/selldialog.h
index 2002c67e4..91dcf74c8 100644
--- a/src/gui/selldialog.h
+++ b/src/gui/selldialog.h
@@ -99,7 +99,7 @@ class SellDialog final : public Window,
/**
* Sets the visibility of this window.
*/
- void setVisible(bool visible);
+ void setVisible(bool visible) override;
void addItem(const int id, const unsigned char color,
const int amount, const int price);