summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-16 13:56:14 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-16 13:56:14 +0300
commitf880384018ee23efdc5cc072789e176208956a06 (patch)
tree78726f9c32da3dbc49875392f769f082bda752e7 /src/gui/windows
parent9e3f92a3914e28ce01331d7df7d03c31244a843b (diff)
downloadmv-f880384018ee23efdc5cc072789e176208956a06.tar.gz
mv-f880384018ee23efdc5cc072789e176208956a06.tar.bz2
mv-f880384018ee23efdc5cc072789e176208956a06.tar.xz
mv-f880384018ee23efdc5cc072789e176208956a06.zip
Remove useless casts with KeyEvent.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/charcreatedialog.cpp2
-rw-r--r--src/gui/windows/charselectdialog.cpp2
-rw-r--r--src/gui/windows/chatwindow.cpp2
-rw-r--r--src/gui/windows/editserverdialog.cpp3
-rw-r--r--src/gui/windows/inventorywindow.cpp10
-rw-r--r--src/gui/windows/logindialog.cpp3
-rw-r--r--src/gui/windows/quitdialog.cpp2
-rw-r--r--src/gui/windows/registerdialog.cpp3
-rw-r--r--src/gui/windows/serverdialog.cpp2
-rw-r--r--src/gui/windows/updaterwindow.cpp2
-rw-r--r--src/gui/windows/worldselectdialog.cpp3
11 files changed, 12 insertions, 22 deletions
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index 0d324439b..a3fdcde3a 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -667,7 +667,7 @@ void CharCreateDialog::updatePlayer()
void CharCreateDialog::keyPressed(KeyEvent &keyEvent)
{
- const int actionId = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int actionId = keyEvent.getActionId();
switch (actionId)
{
case Input::KEY_GUI_CANCEL:
diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp
index b18e6df5b..7c6e387a4 100644
--- a/src/gui/windows/charselectdialog.cpp
+++ b/src/gui/windows/charselectdialog.cpp
@@ -318,7 +318,7 @@ void CharSelectDialog::use(const int selected)
void CharSelectDialog::keyPressed(KeyEvent &keyEvent)
{
- const int actionId = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int actionId = keyEvent.getActionId();
switch (actionId)
{
case Input::KEY_GUI_CANCEL:
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 11551b5cb..1e71c50ae 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -840,7 +840,7 @@ void ChatWindow::mouseDragged(gcn::MouseEvent &event)
void ChatWindow::keyPressed(KeyEvent &event)
{
const int key = event.getKey().getValue();
- const int actionId = static_cast<KeyEvent*>(&event)->getActionId();
+ const int actionId = event.getActionId();
if (actionId == static_cast<int>(Input::KEY_GUI_DOWN))
{
if (mCurHist != mHistory.end())
diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp
index 82c255863..2286a9b36 100644
--- a/src/gui/windows/editserverdialog.cpp
+++ b/src/gui/windows/editserverdialog.cpp
@@ -290,8 +290,7 @@ void EditServerDialog::keyPressed(KeyEvent &keyEvent)
if (keyEvent.isConsumed())
return;
- const int actionId = static_cast<KeyEvent*>(
- &keyEvent)->getActionId();
+ const int actionId = keyEvent.getActionId();
if (actionId == static_cast<int>(Input::KEY_GUI_CANCEL))
{
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 24b5cdab3..a1eb83e7a 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -615,20 +615,14 @@ void InventoryWindow::mouseExited(gcn::MouseEvent &event A_UNUSED)
void InventoryWindow::keyPressed(KeyEvent &event)
{
- if (static_cast<KeyEvent*>(&event)->getActionId()
- == static_cast<int>(Input::KEY_GUI_MOD))
- {
+ if (event.getActionId() == static_cast<int>(Input::KEY_GUI_MOD))
mSplit = true;
- }
}
void InventoryWindow::keyReleased(KeyEvent &event)
{
- if (static_cast<KeyEvent*>(&event)->getActionId()
- == static_cast<int>(Input::KEY_GUI_MOD))
- {
+ if (event.getActionId() == static_cast<int>(Input::KEY_GUI_MOD))
mSplit = false;
- }
}
void InventoryWindow::valueChanged(const gcn::SelectionEvent &event A_UNUSED)
diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp
index f9988a0c3..bfa20af62 100644
--- a/src/gui/windows/logindialog.cpp
+++ b/src/gui/windows/logindialog.cpp
@@ -327,8 +327,7 @@ void LoginDialog::keyPressed(KeyEvent &keyEvent)
return;
}
- const int actionId = static_cast<KeyEvent*>(
- &keyEvent)->getActionId();
+ const int actionId = keyEvent.getActionId();
if (actionId == static_cast<int>(Input::KEY_GUI_CANCEL))
{
action(ActionEvent(nullptr, mServerButton->getActionEventId()));
diff --git a/src/gui/windows/quitdialog.cpp b/src/gui/windows/quitdialog.cpp
index c47fb1f0e..98aa70c70 100644
--- a/src/gui/windows/quitdialog.cpp
+++ b/src/gui/windows/quitdialog.cpp
@@ -205,7 +205,7 @@ void QuitDialog::action(const ActionEvent &event)
void QuitDialog::keyPressed(KeyEvent &keyEvent)
{
- const int actionId = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int actionId = keyEvent.getActionId();
int dir = 0;
switch (actionId)
diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp
index 530a33758..50344f223 100644
--- a/src/gui/windows/registerdialog.cpp
+++ b/src/gui/windows/registerdialog.cpp
@@ -289,8 +289,7 @@ void RegisterDialog::keyPressed(KeyEvent &keyEvent)
mRegisterButton->setEnabled(canSubmit());
return;
}
- const int actionId = static_cast<KeyEvent*>(
- &keyEvent)->getActionId();
+ const int actionId = keyEvent.getActionId();
if (actionId == static_cast<int>(Input::KEY_GUI_CANCEL))
{
action(ActionEvent(nullptr, mCancelButton->getActionEventId()));
diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp
index 6d61b3eb2..c4bd7c79f 100644
--- a/src/gui/windows/serverdialog.cpp
+++ b/src/gui/windows/serverdialog.cpp
@@ -447,7 +447,7 @@ void ServerDialog::action(const ActionEvent &event)
void ServerDialog::keyPressed(KeyEvent &keyEvent)
{
- switch (static_cast<KeyEvent*>(&keyEvent)->getActionId())
+ switch (keyEvent.getActionId())
{
case Input::KEY_GUI_CANCEL:
keyEvent.consume();
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index 12a5cb0c4..109858a07 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -293,7 +293,7 @@ void UpdaterWindow::action(const ActionEvent &event)
void UpdaterWindow::keyPressed(KeyEvent &keyEvent)
{
- const int actionId = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int actionId = keyEvent.getActionId();
if (actionId == static_cast<int>(Input::KEY_GUI_CANCEL))
{
action(ActionEvent(nullptr, mCancelButton->getActionEventId()));
diff --git a/src/gui/windows/worldselectdialog.cpp b/src/gui/windows/worldselectdialog.cpp
index 03545bcc4..0d861b85c 100644
--- a/src/gui/windows/worldselectdialog.cpp
+++ b/src/gui/windows/worldselectdialog.cpp
@@ -156,8 +156,7 @@ void WorldSelectDialog::action(const ActionEvent &event)
void WorldSelectDialog::keyPressed(KeyEvent &keyEvent)
{
- const int actionId = static_cast<KeyEvent*>(
- &keyEvent)->getActionId();
+ const int actionId = keyEvent.getActionId();
if (actionId == static_cast<int>(Input::KEY_GUI_CANCEL))
{