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/setup.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/setup.cpp')
-rw-r--r-- | src/gui/setup.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index 69e879b9c..af67129e0 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -148,23 +148,25 @@ void Setup::action(const gcn::ActionEvent &event) { if (Game::instance()) Game::instance()->resetAdjustLevel(); - if (event.getId() == "Apply") + const std::string &eventId = event.getId(); + + if (eventId == "Apply") { setVisible(false); for_each(mTabs.begin(), mTabs.end(), std::mem_fun(&SetupTab::apply)); } - else if (event.getId() == "Cancel") + else if (eventId == "Cancel") { doCancel(); } - else if (event.getId() == "Store") + else if (eventId == "Store") { if (chatWindow) chatWindow->saveState(); config.write(); serverConfig.write(); } - else if (event.getId() == "Reset Windows") + else if (eventId == "Reset Windows") { // Bail out if this action happens to be activated before the windows // are created (though it should be disabled then) |