From 5cbd0d2cb7086fda592c00dbc3b07d06af95f080 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 30 Aug 2012 22:53:27 +0300 Subject: Add const to more classes. --- src/gui/widgets/spellshortcutcontainer.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/gui/widgets/spellshortcutcontainer.cpp') 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 *const g = static_cast(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(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(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); -- cgit v1.2.3-70-g09d2