summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/chatwindow.cpp2
-rw-r--r--src/gui/windows/inventorywindow.cpp9
-rw-r--r--src/gui/windows/inventorywindow.h2
-rw-r--r--src/gui/windows/killstats.cpp1
-rw-r--r--src/gui/windows/tradewindow.cpp2
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);