summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-18 15:14:19 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-19 15:12:20 +0300
commitb36dcf86bb443770dd8fc2ea08c709f92115613a (patch)
treec58a60553e521e37ad0da5b9818dc3b8c8b06e6b
parentc7ce3fa82460fdd426fad8f6aaea0351f7d8c787 (diff)
downloadmv-b36dcf86bb443770dd8fc2ea08c709f92115613a.tar.gz
mv-b36dcf86bb443770dd8fc2ea08c709f92115613a.tar.bz2
mv-b36dcf86bb443770dd8fc2ea08c709f92115613a.tar.xz
mv-b36dcf86bb443770dd8fc2ea08c709f92115613a.zip
move virtual member calls from inventory window constuctor into postInit.
-rw-r--r--src/game.cpp1
-rw-r--r--src/gui/windows/inventorywindow.cpp4
-rw-r--r--src/gui/windows/inventorywindow.h2
-rw-r--r--src/net/ea/inventoryhandler.cpp3
4 files changed, 10 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 3e2b1859d..50cb1377e 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -219,6 +219,7 @@ static void createGuiWindows()
statusWindow = new StatusWindow;
miniStatusWindow = new MiniStatusWindow;
inventoryWindow = new InventoryWindow(PlayerInfo::getInventory());
+ inventoryWindow->postInit();
shopWindow = new ShopWindow;
skillDialog = new SkillDialog;
minimap = new Minimap;
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index dde1bf709..6fffb3cf2 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -282,6 +282,10 @@ InventoryWindow::InventoryWindow(Inventory *const inventory):
loadWindowState();
enableVisibleSound(true);
+}
+
+void InventoryWindow::postInit()
+{
slotsChanged(mInventory);
mItems->setSortType(mSortDropDown->getSelected());
diff --git a/src/gui/windows/inventorywindow.h b/src/gui/windows/inventorywindow.h
index 459e3bfa2..d8742dd64 100644
--- a/src/gui/windows/inventorywindow.h
+++ b/src/gui/windows/inventorywindow.h
@@ -69,6 +69,8 @@ class InventoryWindow final : public Window,
*/
~InventoryWindow();
+ void postInit() override;
+
void storeSortOrder();
/**
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index f8bb619e9..be761fa19 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -428,7 +428,10 @@ void InventoryHandler::processPlayerStorageStatus(Net::MessageIn &msg)
mInventoryItems.clear();
if (!mStorageWindow)
+ {
mStorageWindow = new InventoryWindow(mStorage);
+ mStorageWindow->postInit();
+ }
}
void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg)