diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-08 13:51:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-08 17:55:40 +0300 |
commit | 9247c5a23757e01ef7ee91dd5655fcab177e5e6d (patch) | |
tree | 38e947cdaa6f1ec33651560b81851b7a255a58ac /src/gui/windows | |
parent | fcf53dd7d524c2204f39269be5768a1919daef42 (diff) | |
download | mv-9247c5a23757e01ef7ee91dd5655fcab177e5e6d.tar.gz mv-9247c5a23757e01ef7ee91dd5655fcab177e5e6d.tar.bz2 mv-9247c5a23757e01ef7ee91dd5655fcab177e5e6d.tar.xz mv-9247c5a23757e01ef7ee91dd5655fcab177e5e6d.zip |
fix code style.
Diffstat (limited to 'src/gui/windows')
-rw-r--r-- | src/gui/windows/chatwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/inventorywindow.cpp | 9 | ||||
-rw-r--r-- | src/gui/windows/inventorywindow.h | 2 | ||||
-rw-r--r-- | src/gui/windows/killstats.cpp | 1 | ||||
-rw-r--r-- | src/gui/windows/tradewindow.cpp | 2 |
5 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 71915ab08..e9436bd34 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -351,7 +351,7 @@ void ChatWindow::adjustTabSize() { const int chatButtonSize = 20; int w = awFrame2 - chatButtonSize; - int x = aw - frame - chatButtonSize; + const int x = aw - frame - chatButtonSize; if (mSkin) { const int ipad = mSkin->getOption("emoteButtonSpacing", 2); diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index a12dca882..92b21dfd1 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -59,8 +59,6 @@ #include "net/inventoryhandler.h" #include "net/net.h" -#include "utils/gettext.h" - #include <string> #include "debug.h" @@ -281,7 +279,7 @@ InventoryWindow::~InventoryWindow() mTextPopup = nullptr; } -void InventoryWindow::storeSortOrder() +void InventoryWindow::storeSortOrder() const { if (mInventory) { @@ -669,7 +667,8 @@ void InventoryWindow::updateButtons(const Item *item) void InventoryWindow::setSplitAllowed(const bool allowed) { - mSplitButton->setVisible(allowed); + if (mSplitButton) + mSplitButton->setVisible(allowed); } void InventoryWindow::close() @@ -699,7 +698,7 @@ void InventoryWindow::processEvent(const Channels channel A_UNUSED, void InventoryWindow::updateWeight() { - if (!isMainInventory()) + if (!isMainInventory() || !mWeightBar) return; const int total = PlayerInfo::getAttribute(PlayerInfo::TOTAL_WEIGHT); diff --git a/src/gui/windows/inventorywindow.h b/src/gui/windows/inventorywindow.h index c81e83d77..7e47e0362 100644 --- a/src/gui/windows/inventorywindow.h +++ b/src/gui/windows/inventorywindow.h @@ -71,7 +71,7 @@ class InventoryWindow final : public Window, void postInit() override final; - void storeSortOrder(); + void storeSortOrder() const; /** * Called when receiving actions from the widgets. diff --git a/src/gui/windows/killstats.cpp b/src/gui/windows/killstats.cpp index f4557a460..456af0ebb 100644 --- a/src/gui/windows/killstats.cpp +++ b/src/gui/windows/killstats.cpp @@ -34,7 +34,6 @@ #include "being/playerinfo.h" #include "utils/gettext.h" -#include "utils/stringutils.h" #include "debug.h" diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index 506f25c17..443c38619 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -440,7 +440,7 @@ void TradeWindow::initTrade(const std::string &nick) const Inventory *const inv = PlayerInfo::getInventory(); if (inv) { - Item *const item = inv->findItem(mAutoAddItem->getId(), + const Item *const item = inv->findItem(mAutoAddItem->getId(), mAutoAddItem->getColor()); if (item) tradeItem(item, mAutoAddAmount); |