diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-28 01:59:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-28 01:59:04 +0300 |
commit | c79403e1341ac533df1771b866d1f5cee15e12b5 (patch) | |
tree | 5bed6dfb44f7fce0432bd7a7a28d2d23db07ce80 /src/gui/setup_colors.cpp | |
parent | 7c79aa2b8e484319e3e511fa21db6d2448347024 (diff) | |
download | manaplus-c79403e1341ac533df1771b866d1f5cee15e12b5.tar.gz manaplus-c79403e1341ac533df1771b866d1f5cee15e12b5.tar.bz2 manaplus-c79403e1341ac533df1771b866d1f5cee15e12b5.tar.xz manaplus-c79403e1341ac533df1771b866d1f5cee15e12b5.zip |
Add const to more classes.
Diffstat (limited to 'src/gui/setup_colors.cpp')
-rw-r--r-- | src/gui/setup_colors.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp index 09468a4a9..80cb89d8a 100644 --- a/src/gui/setup_colors.cpp +++ b/src/gui/setup_colors.cpp @@ -243,9 +243,9 @@ void Setup_Colors::valueChanged(const gcn::SelectionEvent &event A_UNUSED) return; mSelected = mColorBox->getSelected(); - int type = userPalette->getColorTypeAt(mSelected); + const int type = userPalette->getColorTypeAt(mSelected); const gcn::Color *col = &userPalette->getColor(type); - Palette::GradientType grad = userPalette->getGradientType(type); + const Palette::GradientType grad = userPalette->getGradientType(type); const int delay = userPalette->getGradientDelay(type); mPreview->clearRows(); @@ -345,7 +345,8 @@ void Setup_Colors::valueChanged(const gcn::SelectionEvent &event A_UNUSED) mGradTypeSlider->setEnabled(true); } -void Setup_Colors::setEntry(gcn::Slider *s, TextField *t, int value) +void Setup_Colors::setEntry(gcn::Slider *const s, TextField *const t, + const int value) { if (s) s->setValue(value); @@ -369,8 +370,8 @@ void Setup_Colors::cancel() return; userPalette->rollback(); - int type = userPalette->getColorTypeAt(mSelected); - const gcn::Color *col = &userPalette->getColor(type); + const int type = userPalette->getColorTypeAt(mSelected); + const gcn::Color *const col = &userPalette->getColor(type); mGradTypeSlider->setValue(userPalette->getGradientType(type)); const int delay = userPalette->getGradientDelay(type); setEntry(mGradDelaySlider, mGradDelayText, delay); @@ -404,8 +405,8 @@ void Setup_Colors::updateGradType() return; mSelected = mColorBox->getSelected(); - int type = userPalette->getColorTypeAt(mSelected); - Palette::GradientType grad = userPalette->getGradientType(type); + const int type = userPalette->getColorTypeAt(mSelected); + const Palette::GradientType grad = userPalette->getGradientType(type); mGradTypeText->setCaption( (grad == Palette::STATIC) ? _("Static") : @@ -432,10 +433,10 @@ void Setup_Colors::updateColor() if (mSelected == -1 || !userPalette) return; - int type = userPalette->getColorTypeAt(mSelected); - Palette::GradientType grad = static_cast<Palette::GradientType>( + const int type = userPalette->getColorTypeAt(mSelected); + const Palette::GradientType grad = static_cast<Palette::GradientType>( static_cast<int>(mGradTypeSlider->getValue())); - int delay = static_cast<int>(mGradDelaySlider->getValue()); + const int delay = static_cast<int>(mGradDelaySlider->getValue()); userPalette->setGradient(type, grad); userPalette->setGradientDelay(type, delay); |