diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-02-13 22:58:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-02-14 01:42:53 +0300 |
commit | e40411cdc287343a32a8371f2116fcc11545b466 (patch) | |
tree | 4655f02211f1b08b8ead94175fd419c6e766f9c8 /src/gui/tradewindow.cpp | |
parent | 2ebce73d5018945bb5f5363913a4096e04bf5a0f (diff) | |
download | ManaVerse-e40411cdc287343a32a8371f2116fcc11545b466.tar.gz ManaVerse-e40411cdc287343a32a8371f2116fcc11545b466.tar.bz2 ManaVerse-e40411cdc287343a32a8371f2116fcc11545b466.tar.xz ManaVerse-e40411cdc287343a32a8371f2116fcc11545b466.zip |
Improve event.getId() speed.
Diffstat (limited to 'src/gui/tradewindow.cpp')
-rw-r--r-- | src/gui/tradewindow.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/tradewindow.cpp b/src/gui/tradewindow.cpp index 64f06f6c8..c5dcfd21f 100644 --- a/src/gui/tradewindow.cpp +++ b/src/gui/tradewindow.cpp @@ -318,8 +318,9 @@ void TradeWindow::action(const gcn::ActionEvent &event) return; Item *const item = inventoryWindow->getSelectedItem(); + const std::string &eventId = event.getId(); - if (event.getId() == "add") + if (eventId == "add") { if (mStatus != PREPARING) return; @@ -345,7 +346,7 @@ void TradeWindow::action(const gcn::ActionEvent &event) setStatus(PREPARING); } - else if (event.getId() == "cancel") + else if (eventId == "cancel") { setVisible(false); reset(); @@ -353,7 +354,7 @@ void TradeWindow::action(const gcn::ActionEvent &event) Net::getTradeHandler()->cancel(); } - else if (event.getId() == "ok") + else if (eventId == "ok") { mMoneyField->setEnabled(false); mAddButton->setEnabled(false); @@ -362,13 +363,13 @@ void TradeWindow::action(const gcn::ActionEvent &event) setStatus(PROPOSING); Net::getTradeHandler()->confirm(); } - else if (event.getId() == "trade") + else if (eventId == "trade") { receivedOk(true); setStatus(ACCEPTED); Net::getTradeHandler()->finish(); } - else if (event.getId() == "money") + else if (eventId == "money") { if (mStatus != PREPARING) return; |