summaryrefslogtreecommitdiff
path: root/src/gui/windows/itemamountwindow.cpp
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/itemamountwindow.cpp
parent4cf136b90ee361051bd29c615065f7bbc20b75b0 (diff)
downloadmv-055dab920b331ebbebc2a9145ccdc752f638c62a.tar.gz
mv-055dab920b331ebbebc2a9145ccdc752f638c62a.tar.bz2
mv-055dab920b331ebbebc2a9145ccdc752f638c62a.tar.xz
mv-055dab920b331ebbebc2a9145ccdc752f638c62a.zip
move virtual member calls from itemamountwindow constuctor into postInit.
Diffstat (limited to 'src/gui/windows/itemamountwindow.cpp')
-rw-r--r--src/gui/windows/itemamountwindow.cpp12
1 files changed, 7 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();
}