summaryrefslogtreecommitdiff
path: root/src/gui/widgets/setupitem.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-13 22:58:01 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-14 01:42:53 +0300
commite40411cdc287343a32a8371f2116fcc11545b466 (patch)
tree4655f02211f1b08b8ead94175fd419c6e766f9c8 /src/gui/widgets/setupitem.cpp
parent2ebce73d5018945bb5f5363913a4096e04bf5a0f (diff)
downloadmv-e40411cdc287343a32a8371f2116fcc11545b466.tar.gz
mv-e40411cdc287343a32a8371f2116fcc11545b466.tar.bz2
mv-e40411cdc287343a32a8371f2116fcc11545b466.tar.xz
mv-e40411cdc287343a32a8371f2116fcc11545b466.zip
Improve event.getId() speed.
Diffstat (limited to 'src/gui/widgets/setupitem.cpp')
-rw-r--r--src/gui/widgets/setupitem.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp
index efa96136f..d9071aec4 100644
--- a/src/gui/widgets/setupitem.cpp
+++ b/src/gui/widgets/setupitem.cpp
@@ -324,17 +324,18 @@ void SetupItemTextField::action(const gcn::ActionEvent &event)
if (!mTextField)
return;
- if (event.getId() == mWidget->getActionEventId())
+ const std::string &eventId = event.getId();
+ if (eventId == mWidget->getActionEventId())
{
fromWidget();
}
- else if (event.getId() == mEventName + "_EDIT")
+ else if (eventId == mEventName + "_EDIT")
{
mEditDialog = new EditDialog(mText, mTextField->getText(),
mEventName + "_EDIT_OK");
mEditDialog->addActionListener(this);
}
- else if (event.getId() == mEventName + "_EDIT_OK")
+ else if (eventId == mEventName + "_EDIT_OK")
{
mTextField->setText(mEditDialog->getMsg());
mEditDialog = nullptr;
@@ -449,17 +450,18 @@ void SetupItemIntTextField::action(const gcn::ActionEvent &event)
if (!mTextField)
return;
- if (event.getId() == mWidget->getActionEventId())
+ const std::string &eventId = event.getId();
+ if (eventId == mWidget->getActionEventId())
{
fromWidget();
}
- else if (event.getId() == mEventName + "_EDIT")
+ else if (eventId == mEventName + "_EDIT")
{
mEditDialog = new EditDialog(mText, mTextField->getText(),
mEventName + "_EDIT_OK");
mEditDialog->addActionListener(this);
}
- else if (event.getId() == mEventName + "_EDIT_OK")
+ else if (eventId == mEventName + "_EDIT_OK")
{
mTextField->setValue(atoi(mEditDialog->getMsg().c_str()));
mEditDialog = nullptr;