summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.cpp2
-rw-r--r--src/gui/widgets/button.cpp2
-rw-r--r--src/gui/widgets/dropdown.cpp2
-rw-r--r--src/gui/widgets/equipmentpage.h3
-rw-r--r--src/gui/widgets/inttextfield.cpp2
-rw-r--r--src/gui/widgets/slider.cpp2
-rw-r--r--src/gui/widgets/tabbedarea.cpp2
-rw-r--r--src/gui/widgets/tabstrip.cpp2
-rw-r--r--src/gui/windows/buyselldialog.cpp2
-rw-r--r--src/gui/windows/charcreatedialog.cpp2
-rw-r--r--src/gui/windows/charselectdialog.cpp12
-rw-r--r--src/gui/windows/chatwindow.cpp1
-rw-r--r--src/gui/windows/editserverdialog.cpp2
-rw-r--r--src/gui/windows/equipmentwindow.cpp2
-rw-r--r--src/gui/windows/equipmentwindow.h3
-rw-r--r--src/gui/windows/inventorywindow.cpp2
-rw-r--r--src/gui/windows/logindialog.cpp2
-rw-r--r--src/gui/windows/ministatuswindow.cpp3
-rw-r--r--src/gui/windows/quitdialog.cpp2
-rw-r--r--src/gui/windows/registerdialog.cpp2
-rw-r--r--src/gui/windows/statuswindow.cpp3
-rw-r--r--src/gui/windows/updaterwindow.cpp2
22 files changed, 12 insertions, 45 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 0f8561643..53d8fe638 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -80,8 +80,6 @@
#include "settings.h"
#include "touchmanager.h"
-#include "events/keyevent.h"
-
#include "listeners/focuslistener.h"
#include "listeners/guiconfiglistener.h"
#include "listeners/keylistener.h"
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index de2bd0c8b..581dd3a9e 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -68,8 +68,6 @@
#include "graphicsvertexes.h"
#include "settings.h"
-#include "events/keyevent.h"
-
#include "input/inputaction.h"
#include "resources/image.h"
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index 7957b0587..db951692e 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -24,8 +24,6 @@
#include "settings.h"
-#include "events/keyevent.h"
-
#include "input/inputaction.h"
#include "gui/gui.h"
diff --git a/src/gui/widgets/equipmentpage.h b/src/gui/widgets/equipmentpage.h
index bbafca15d..a62159cd1 100644
--- a/src/gui/widgets/equipmentpage.h
+++ b/src/gui/widgets/equipmentpage.h
@@ -25,9 +25,10 @@
#include "localconsts.h"
-class EquipmentBox;
class PlayerBox;
+struct EquipmentBox;
+
struct EquipmentPage final
{
EquipmentPage() :
diff --git a/src/gui/widgets/inttextfield.cpp b/src/gui/widgets/inttextfield.cpp
index c2d84c66a..b268f3ce6 100644
--- a/src/gui/widgets/inttextfield.cpp
+++ b/src/gui/widgets/inttextfield.cpp
@@ -26,8 +26,6 @@
#include "gui/sdlinput.h"
#endif
-#include "events/keyevent.h"
-
#include "input/inputaction.h"
#include "utils/stringutils.h"
diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp
index e36c24b2c..4a7bf6ad1 100644
--- a/src/gui/widgets/slider.cpp
+++ b/src/gui/widgets/slider.cpp
@@ -68,8 +68,6 @@
#include "graphicsvertexes.h"
#include "settings.h"
-#include "events/keyevent.h"
-
#include "input/inputaction.h"
#include "gui/gui.h"
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index 36e3aa093..cbe304970 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -65,8 +65,6 @@
#include "gui/widgets/tabbedarea.h"
-#include "events/keyevent.h"
-
#include "input/inputaction.h"
#include "gui/gui.h"
diff --git a/src/gui/widgets/tabstrip.cpp b/src/gui/widgets/tabstrip.cpp
index a5b5fd7e6..7c6627fbf 100644
--- a/src/gui/widgets/tabstrip.cpp
+++ b/src/gui/widgets/tabstrip.cpp
@@ -49,7 +49,7 @@ Widget *TabStrip::createWidget(const std::string &text) const
widget->adjustSize();
if (!mCount)
widget->setPressed(true);
- widget->setTag(mWidgets.size());
+ widget->setTag(static_cast<int>(mWidgets.size()));
return widget;
}
diff --git a/src/gui/windows/buyselldialog.cpp b/src/gui/windows/buyselldialog.cpp
index 2de5841bc..eacd952bd 100644
--- a/src/gui/windows/buyselldialog.cpp
+++ b/src/gui/windows/buyselldialog.cpp
@@ -65,7 +65,7 @@ void BuySellDialog::init()
if (setupWindow)
setupWindow->registerWindowForReset(this);
- static const char *buttonNames[] =
+ static const char *const buttonNames[] =
{
// TRANSLATORS: shop window button
N_("Buy"),
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index b34f8f50a..05dfb2171 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -24,8 +24,6 @@
#include "main.h"
-#include "events/keyevent.h"
-
#include "input/inputaction.h"
#include "gui/dialogtype.h"
diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp
index 5ec3ab2b7..fef43b605 100644
--- a/src/gui/windows/charselectdialog.cpp
+++ b/src/gui/windows/charselectdialog.cpp
@@ -26,8 +26,6 @@
#include "configuration.h"
#include "units.h"
-#include "events/keyevent.h"
-
#include "input/inputaction.h"
#include "being/attributes.h"
@@ -234,7 +232,7 @@ void CharSelectDialog::action(const ActionEvent &event)
else if (eventId == "rename"
&& mCharacterEntries[selected]->getCharacter())
{
- LocalPlayer *const player = mCharacterEntries[
+ const LocalPlayer *const player = mCharacterEntries[
selected]->getCharacter()->dummy;
EditDialog *const dialog = new EditDialog(
_("Please enter new name"), player->getName(), "OK");
@@ -525,8 +523,7 @@ void CharSelectDialog::setLocked(const bool locked)
mUnregisterButton->setEnabled(!locked);
if (mChangeEmailButton)
mChangeEmailButton->setEnabled(!locked);
- if (mPlayButton)
- mPlayButton->setEnabled(!locked);
+ mPlayButton->setEnabled(!locked);
if (mDeleteButton)
mDeleteButton->setEnabled(!locked);
@@ -575,8 +572,7 @@ void CharSelectDialog::close()
void CharSelectDialog::widgetResized(const Event &event)
{
Window::widgetResized(event);
- if (mCharacterView)
- mCharacterView->resize();
+ mCharacterView->resize();
}
void CharSelectDialog::updateState()
@@ -594,7 +590,7 @@ void CharSelectDialog::updateState()
// TRANSLATORS: char select dialog. button.
mPlayButton->setCaption(_("Play"));
- LocalPlayer *const player = mCharacterEntries[
+ const LocalPlayer *const player = mCharacterEntries[
idx]->getCharacter()->dummy;
if (player && mRenameButton)
mRenameButton->setEnabled(player->getRename() ? true : false);
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 559c87704..da64f195d 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -67,7 +67,6 @@
#include "render/opengldebug.h"
#include "net/chathandler.h"
-#include "net/playerhandler.h"
#include "utils/copynpaste.h"
#include "utils/delete2.h"
diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp
index 5e5997985..6d06bba08 100644
--- a/src/gui/windows/editserverdialog.cpp
+++ b/src/gui/windows/editserverdialog.cpp
@@ -21,8 +21,6 @@
#include "gui/windows/editserverdialog.h"
-#include "events/keyevent.h"
-
#include "input/inputaction.h"
#include "gui/dialogtype.h"
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp
index 76863ffbd..08c6aea51 100644
--- a/src/gui/windows/equipmentwindow.cpp
+++ b/src/gui/windows/equipmentwindow.cpp
@@ -773,5 +773,5 @@ int EquipmentWindow::addPage(const std::string &name)
boxes.push_back(nullptr);
mTabs->addButton(name);
- return mPages.size() - 1;
+ return static_cast<int>(mPages.size()) - 1;
}
diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h
index 628b2fdbe..8c77b6d28 100644
--- a/src/gui/windows/equipmentwindow.h
+++ b/src/gui/windows/equipmentwindow.h
@@ -26,7 +26,6 @@
#include "equipment.h"
#include "localconsts.h"
-#include "gui/widgets/equipmentpage.h"
#include "gui/widgets/window.h"
#include "utils/xml.h"
@@ -43,7 +42,7 @@ class Item;
class PlayerBox;
class TabStrip;
-struct EquipmentBox;
+struct EquipmentPage;
/**
* Equipment dialog.
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 390b0400b..c1fea4158 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -29,8 +29,6 @@
#include "being/attributes.h"
#include "being/playerinfo.h"
-#include "events/keyevent.h"
-
#include "input/inputmanager.h"
#include "gui/gui.h"
diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp
index 8f6256616..41cf22f17 100644
--- a/src/gui/windows/logindialog.cpp
+++ b/src/gui/windows/logindialog.cpp
@@ -25,8 +25,6 @@
#include "client.h"
#include "configuration.h"
-#include "events/keyevent.h"
-
#include "input/inputaction.h"
#include "listeners/openurllistener.h"
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index 40d4c1124..adcd1c9d2 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -121,8 +121,7 @@ MiniStatusWindow::MiniStatusWindow() :
if (gameHandler->canUseMagicBar() && statusWindow)
statusWindow->updateMPBar(mMpBar);
- const int job = Attributes::JOB
- && serverConfig.getValueBool("showJob", true);
+ const bool job = serverConfig.getValueBool("showJob", true);
StatusWindow::updateXPBar(mXpBar);
diff --git a/src/gui/windows/quitdialog.cpp b/src/gui/windows/quitdialog.cpp
index c5cd311a3..67020a47d 100644
--- a/src/gui/windows/quitdialog.cpp
+++ b/src/gui/windows/quitdialog.cpp
@@ -27,8 +27,6 @@
#include "soundconsts.h"
#include "soundmanager.h"
-#include "events/keyevent.h"
-
#include "input/inputaction.h"
#include "gui/dialogsmanager.h"
diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp
index 3b4ee0539..d09725e95 100644
--- a/src/gui/windows/registerdialog.cpp
+++ b/src/gui/windows/registerdialog.cpp
@@ -24,8 +24,6 @@
#include "client.h"
-#include "events/keyevent.h"
-
#include "input/inputaction.h"
#include "listeners/wrongdatanoticelistener.h"
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index 227528b20..9d979f27f 100644
--- a/src/gui/windows/statuswindow.cpp
+++ b/src/gui/windows/statuswindow.cpp
@@ -128,8 +128,7 @@ StatusWindow::StatusWindow() :
getThemeColor(Theme::XP_BAR_OUTLINE));
const bool magicBar = gameHandler->canUseMagicBar();
- const int job = Attributes::JOB
- && serverConfig.getValueBool("showJob", true);
+ const bool job = serverConfig.getValueBool("showJob", true);
if (magicBar)
{
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index 5dc0a7708..a12219c7a 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -26,8 +26,6 @@
#include "configuration.h"
#include "settings.h"
-#include "events/keyevent.h"
-
#include "input/inputaction.h"
#include "gui/widgets/browserbox.h"