summaryrefslogtreecommitdiff
path: root/src/gui/itemamountwindow.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/itemamountwindow.cpp
parent2ebce73d5018945bb5f5363913a4096e04bf5a0f (diff)
downloadmanaplus-e40411cdc287343a32a8371f2116fcc11545b466.tar.gz
manaplus-e40411cdc287343a32a8371f2116fcc11545b466.tar.bz2
manaplus-e40411cdc287343a32a8371f2116fcc11545b466.tar.xz
manaplus-e40411cdc287343a32a8371f2116fcc11545b466.zip
Improve event.getId() speed.
Diffstat (limited to 'src/gui/itemamountwindow.cpp')
-rw-r--r--src/gui/itemamountwindow.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/gui/itemamountwindow.cpp b/src/gui/itemamountwindow.cpp
index 3ebc899c7..06320e295 100644
--- a/src/gui/itemamountwindow.cpp
+++ b/src/gui/itemamountwindow.cpp
@@ -325,12 +325,13 @@ void ItemAmountWindow::resetAmount()
void ItemAmountWindow::action(const gcn::ActionEvent &event)
{
- if (event.getId() == "cancel")
+ const std::string &eventId = event.getId();
+ if (eventId == "cancel")
{
close();
return;
}
- else if (event.getId() == "ok")
+ else if (eventId == "ok")
{
if (mItemPriceTextField)
{
@@ -345,7 +346,7 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event)
close();
return;
}
- else if (event.getId() == "itemType")
+ else if (eventId == "itemType")
{
if (!mItemDropDown || !mItemsModal)
return;
@@ -366,13 +367,13 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event)
int amount = mItemAmountTextField->getValue();
- if (event.getId() == "inc" && amount < mMax)
+ if (eventId == "inc" && amount < mMax)
amount++;
- else if (event.getId() == "dec" && amount > 1)
+ else if (eventId == "dec" && amount > 1)
amount--;
- else if (event.getId() == "all")
+ else if (eventId == "all")
amount = mMax;
- else if (event.getId() == "slide")
+ else if (eventId == "slide")
amount = static_cast<int>(mItemAmountSlide->getValue());
mItemAmountTextField->setValue(amount);
mItemAmountSlide->setValue(amount);
@@ -386,17 +387,17 @@ void ItemAmountWindow::action(const gcn::ActionEvent &event)
else if (mPrice < 0)
mPrice = 0;
- if (event.getId() == "incPrice")
+ if (eventId == "incPrice")
{
mPrice++;
price = static_cast<int>(pow(10.0, mPrice));
}
- else if (event.getId() == "decPrice")
+ else if (eventId == "decPrice")
{
mPrice--;
price = static_cast<int>(pow(10.0, mPrice));
}
- else if (event.getId() == "slidePrice")
+ else if (eventId == "slidePrice")
{
price = static_cast<int>(mItemPriceSlide->getValue());
if (price)