From 46f0755975033f37eaae9db73c0e2b6499c2a923 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 30 Aug 2012 02:10:59 +0300 Subject: Add const to more classes. --- src/gui/widgets/checkbox.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/gui/widgets/checkbox.cpp') diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp index 72ca9eb8d..759ca9015 100644 --- a/src/gui/widgets/checkbox.cpp +++ b/src/gui/widgets/checkbox.cpp @@ -46,8 +46,9 @@ Image *CheckBox::checkBoxDisabledChecked; Image *CheckBox::checkBoxNormalHi; Image *CheckBox::checkBoxCheckedHi; -CheckBox::CheckBox(const std::string &caption, bool selected, - gcn::ActionListener* listener, std::string eventId): +CheckBox::CheckBox(const std::string &caption, const bool selected, + gcn::ActionListener *const listener, + const std::string &eventId) : gcn::CheckBox(caption, selected), mHasMouse(false) { @@ -152,7 +153,7 @@ void CheckBox::draw(gcn::Graphics* graphics) void CheckBox::updateAlpha() { - float alpha = std::max(Client::getGuiAlpha(), + const float alpha = std::max(Client::getGuiAlpha(), Theme::instance()->getMinimumOpacity()); if (mAlpha != alpha) @@ -173,9 +174,9 @@ void CheckBox::updateAlpha() } } -void CheckBox::drawBox(gcn::Graphics* graphics) +void CheckBox::drawBox(gcn::Graphics *const graphics) { - Image *box; + const Image *box; if (isEnabled()) { @@ -220,7 +221,7 @@ void CheckBox::mouseExited(gcn::MouseEvent& event A_UNUSED) void CheckBox::keyPressed(gcn::KeyEvent& keyEvent) { - int action = static_cast(&keyEvent)->getActionId(); + const int action = static_cast(&keyEvent)->getActionId(); if (action == Input::KEY_GUI_SELECT) { -- cgit v1.2.3-70-g09d2