summaryrefslogtreecommitdiff
path: root/src/gui/widgets/dropdown.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-30 02:10:59 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-30 02:10:59 +0300
commit46f0755975033f37eaae9db73c0e2b6499c2a923 (patch)
tree5c13c361ce4a4e4fd0e07fca1953c54637965666 /src/gui/widgets/dropdown.cpp
parent1feb7f7edc5f8f383e594b256ef4cab0fae75b99 (diff)
downloadplus-46f0755975033f37eaae9db73c0e2b6499c2a923.tar.gz
plus-46f0755975033f37eaae9db73c0e2b6499c2a923.tar.bz2
plus-46f0755975033f37eaae9db73c0e2b6499c2a923.tar.xz
plus-46f0755975033f37eaae9db73c0e2b6499c2a923.zip
Add const to more classes.
Diffstat (limited to 'src/gui/widgets/dropdown.cpp')
-rw-r--r--src/gui/widgets/dropdown.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index 3012c5553..bb18ff2dd 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -54,8 +54,9 @@ static std::string const dropdownFiles[2] =
"dropdown_pressed.xml"
};
-DropDown::DropDown(gcn::ListModel *listModel, gcn::ActionListener* listener,
- std::string eventId):
+DropDown::DropDown(gcn::ListModel *const listModel,
+ gcn::ActionListener *const listener,
+ const std::string &eventId):
gcn::DropDown::DropDown(listModel,
new ScrollArea, new ListBox(listModel)),
mShadowColor(Theme::getThemeColor(Theme::DROPDOWN_SHADOW)),
@@ -69,7 +70,7 @@ DropDown::DropDown(gcn::ListModel *listModel, gcn::ActionListener* listener,
// Load the background skin
for (int i = 0; i < 2; i ++)
{
- Skin *skin = Theme::instance()->load(
+ Skin *const skin = Theme::instance()->load(
dropdownFiles[i], "dropdown.xml");
if (skin)
{
@@ -217,7 +218,7 @@ void DropDown::drawFrame(gcn::Graphics *graphics)
void DropDown::drawButton(gcn::Graphics *graphics)
{
- int height = mDroppedDown ? mFoldedUpHeight : getHeight();
+ const int height = mDroppedDown ? mFoldedUpHeight : getHeight();
if (buttons[mDroppedDown][mPushed])
{
@@ -233,7 +234,7 @@ void DropDown::keyPressed(gcn::KeyEvent& keyEvent)
if (keyEvent.isConsumed())
return;
- int actionId = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const int actionId = static_cast<KeyEvent*>(&keyEvent)->getActionId();
switch (actionId)
{
@@ -305,7 +306,7 @@ void DropDown::mouseWheelMovedDown(gcn::MouseEvent& mouseEvent)
void DropDown::setSelectedString(std::string str)
{
- gcn::ListModel *listModel = mListBox->getListModel();
+ gcn::ListModel *const listModel = mListBox->getListModel();
if (!listModel)
return;
@@ -321,7 +322,7 @@ void DropDown::setSelectedString(std::string str)
std::string DropDown::getSelectedString() const
{
- gcn::ListModel *listModel = mListBox->getListModel();
+ gcn::ListModel *const listModel = mListBox->getListModel();
if (!listModel)
return "";