summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-18 15:24:19 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-19 15:12:20 +0300
commit055dab920b331ebbebc2a9145ccdc752f638c62a (patch)
tree8f0472be0988be490a55fdb01c953b0f943c7f33 /src/gui/windows
parent4cf136b90ee361051bd29c615065f7bbc20b75b0 (diff)
downloadmanaverse-055dab920b331ebbebc2a9145ccdc752f638c62a.tar.gz
manaverse-055dab920b331ebbebc2a9145ccdc752f638c62a.tar.bz2
manaverse-055dab920b331ebbebc2a9145ccdc752f638c62a.tar.xz
manaverse-055dab920b331ebbebc2a9145ccdc752f638c62a.zip
move virtual member calls from itemamountwindow constuctor into postInit.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/itemamountwindow.cpp12
-rw-r--r--src/gui/windows/itemamountwindow.h2
2 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp
index 7ad559c92..0c0f0bfe2 100644
--- a/src/gui/windows/itemamountwindow.cpp
+++ b/src/gui/windows/itemamountwindow.cpp
@@ -156,10 +156,8 @@ ItemAmountWindow::ItemAmountWindow(const Usage usage, Window *const parent,
mEnabledKeyboard(keyboard.isEnabled())
{
if (!mItem)
- {
- setVisible(false);
return;
- }
+
if (usage == ShopBuyAdd)
mMax = 10000;
else if (!mMax)
@@ -297,11 +295,15 @@ ItemAmountWindow::ItemAmountWindow(const Usage usage, Window *const parent,
}
setLocationRelativeTo(getParentWindow());
- setVisible(true);
mItemIcon->addMouseListener(this);
}
+void ItemAmountWindow::postInit()
+{
+ setVisible(mItem);
+}
+
ItemAmountWindow::~ItemAmountWindow()
{
delete mItemPopup;
@@ -448,5 +450,5 @@ void ItemAmountWindow::showWindow(const Usage usage, Window *const parent,
if (usage != ShopBuyAdd && usage != ShopSellAdd && maxRange <= 1)
finish(item, maxRange, 0, usage);
else
- new ItemAmountWindow(usage, parent, item, maxRange);
+ (new ItemAmountWindow(usage, parent, item, maxRange))->postInit();
}
diff --git a/src/gui/windows/itemamountwindow.h b/src/gui/windows/itemamountwindow.h
index 2e741a6cd..45d0d6b83 100644
--- a/src/gui/windows/itemamountwindow.h
+++ b/src/gui/windows/itemamountwindow.h
@@ -60,6 +60,8 @@ class ItemAmountWindow final : public Window,
A_DELETE_COPY(ItemAmountWindow)
+ void postInit();
+
/**
* Called when receiving actions from widget.
*/