summaryrefslogtreecommitdiff
path: root/src/gui/windowmenu.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-03 22:44:42 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-03 22:44:42 +0300
commitb94678289a5e671fc168ec58525b7aae2a56e6ec (patch)
tree475822a9d1acae55f2602facbbb14dba4347fb67 /src/gui/windowmenu.cpp
parent602fd127d09c995bc5470218c862b2cebfc558d5 (diff)
downloadmv-b94678289a5e671fc168ec58525b7aae2a56e6ec.tar.gz
mv-b94678289a5e671fc168ec58525b7aae2a56e6ec.tar.bz2
mv-b94678289a5e671fc168ec58525b7aae2a56e6ec.tar.xz
mv-b94678289a5e671fc168ec58525b7aae2a56e6ec.zip
Remove useless dynamic_cast.
Diffstat (limited to 'src/gui/windowmenu.cpp')
-rw-r--r--src/gui/windowmenu.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp
index 9a48fec7c..81bcd5e6b 100644
--- a/src/gui/windowmenu.cpp
+++ b/src/gui/windowmenu.cpp
@@ -197,7 +197,7 @@ WindowMenu::~WindowMenu()
mButtonNames.clear();
FOR_EACH (std::vector <Button*>::iterator, it, mButtons)
{
- Button *const btn = dynamic_cast<Button*>(*it);
+ Button *const btn = *it;
if (!btn)
continue;
if (!btn->isVisibleLocal())
@@ -321,8 +321,7 @@ void WindowMenu::mouseExited(MouseEvent& event A_UNUSED)
void WindowMenu::showButton(const std::string &name, const bool visible)
{
- const ButtonInfo *const info = dynamic_cast<ButtonInfo *const>(
- mButtonNames[name]);
+ const ButtonInfo *const info = mButtonNames[name];
if (!info || !info->button)
return;
@@ -340,7 +339,7 @@ void WindowMenu::updateButtons()
const int pad2 = 2 * mPadding;
FOR_EACH (std::vector <Button*>::iterator, it, mButtons)
{
- Button *const btn = dynamic_cast<Button *const>(*it);
+ Button *const btn = *it;
if (!btn)
continue;
if (btn->isVisibleLocal())
@@ -381,8 +380,7 @@ void WindowMenu::loadButtons()
"windowmenu" + toString(f), "");
if (str.empty() || str == "SET")
continue;
- const ButtonInfo *const info = dynamic_cast<ButtonInfo *const>(
- mButtonNames[str]);
+ const ButtonInfo *const info = mButtonNames[str];
if (!info || !info->button)
continue;
info->button->setVisible(false);
@@ -410,7 +408,7 @@ void WindowMenu::saveButtons() const
int i = 0;
FOR_EACH (std::vector <Button*>::const_iterator, it, mButtons)
{
- const Button *const btn = dynamic_cast<const Button *const>(*it);
+ const Button *const btn = *it;
if (btn && !btn->isVisibleLocal())
{
config.setValue("windowmenu" + toString(i),