summaryrefslogtreecommitdiff
path: root/src/gui/widgets/spellshortcutcontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-30 22:53:27 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-30 22:53:27 +0300
commit5cbd0d2cb7086fda592c00dbc3b07d06af95f080 (patch)
treed36b4ac344f31f34311c7cb7a9a637ed48356e3e /src/gui/widgets/spellshortcutcontainer.cpp
parent4210163dae7d6266923ab11f78b631173c9533e3 (diff)
downloadmanaverse-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.gz
manaverse-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.bz2
manaverse-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.xz
manaverse-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.zip
Add const to more classes.
Diffstat (limited to 'src/gui/widgets/spellshortcutcontainer.cpp')
-rw-r--r--src/gui/widgets/spellshortcutcontainer.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp
index 5236daec4..ec79ccb93 100644
--- a/src/gui/widgets/spellshortcutcontainer.cpp
+++ b/src/gui/widgets/spellshortcutcontainer.cpp
@@ -44,7 +44,7 @@
#include "debug.h"
-SpellShortcutContainer::SpellShortcutContainer(unsigned number):
+SpellShortcutContainer::SpellShortcutContainer(const unsigned number) :
ShortcutContainer(),
mSpellClicked(false),
mSpellMoved(nullptr),
@@ -99,11 +99,11 @@ void SpellShortcutContainer::draw(gcn::Graphics *graphics)
mBackgroundImg->setAlpha(mAlpha);
}
- Graphics *g = static_cast<Graphics*>(graphics);
+ Graphics *const g = static_cast<Graphics *const>(graphics);
graphics->setFont(getFont());
- int selectedId = spellShortcut->getSelectedItem();
+ const int selectedId = spellShortcut->getSelectedItem();
g->setColor(getForegroundColor());
if (mBackgroundImg)
@@ -120,7 +120,7 @@ void SpellShortcutContainer::draw(gcn::Graphics *graphics)
const int itemX = (i % mGridWidth) * mBoxWidth;
const int itemY = (i / mGridWidth) * mBoxHeight;
- int itemId = spellShortcut->getItem(
+ const int itemId = spellShortcut->getItem(
(mNumber * SPELL_SHORTCUT_ITEMS) + i);
if (selectedId >= 0 && itemId == selectedId)
{
@@ -131,12 +131,12 @@ void SpellShortcutContainer::draw(gcn::Graphics *graphics)
if (!spellManager)
continue;
- TextCommand *spell = spellManager->getSpell(itemId);
+ const TextCommand *const spell = spellManager->getSpell(itemId);
if (spell)
{
if (!spell->isEmpty())
{
- Image* image = spell->getImage();
+ Image *const image = spell->getImage();
if (image)
{
@@ -229,10 +229,10 @@ void SpellShortcutContainer::mouseReleased(gcn::MouseEvent &event)
if (selectedId != itemId)
{
- TextCommand *spell = spellManager->getSpell(itemId);
+ const TextCommand *const spell = spellManager->getSpell(itemId);
if (spell && !spell->isEmpty())
{
- int num = itemShortcutWindow->getTabIndex();
+ const int num = itemShortcutWindow->getTabIndex();
if (num >= 0 && num < static_cast<int>(SHORTCUT_TABS)
&& itemShortcut[num])
{
@@ -244,7 +244,7 @@ void SpellShortcutContainer::mouseReleased(gcn::MouseEvent &event)
}
else
{
- int num = itemShortcutWindow->getTabIndex();
+ const int num = itemShortcutWindow->getTabIndex();
if (num >= 0 && num < static_cast<int>(SHORTCUT_TABS)
&& itemShortcut[num])
{
@@ -279,7 +279,7 @@ void SpellShortcutContainer::mouseMoved(gcn::MouseEvent &event)
(mNumber * SPELL_SHORTCUT_ITEMS) + index);
mSpellPopup->setVisible(false);
- TextCommand *spell = spellManager->getSpell(itemId);
+ TextCommand *const spell = spellManager->getSpell(itemId);
if (spell && !spell->isEmpty())
{
mSpellPopup->setItem(spell);