summaryrefslogtreecommitdiff
path: root/src/gui/socialwindow.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/socialwindow.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/socialwindow.cpp')
-rw-r--r--src/gui/socialwindow.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp
index b5a2d74fc..6c74f4397 100644
--- a/src/gui/socialwindow.cpp
+++ b/src/gui/socialwindow.cpp
@@ -171,7 +171,8 @@ public:
void action(const gcn::ActionEvent &event)
{
- if (event.getId() == "do invite")
+ const std::string &eventId = event.getId();
+ if (eventId == "do invite")
{
std::string name = mInviteDialog->getText();
Net::getGuildHandler()->invite(mGuild->getId(), name);
@@ -184,11 +185,11 @@ public:
}
mInviteDialog = nullptr;
}
- else if (event.getId() == "~do invite")
+ else if (eventId == "~do invite")
{
mInviteDialog = nullptr;
}
- else if (event.getId() == "yes")
+ else if (eventId == "yes")
{
Net::getGuildHandler()->leave(mGuild->getId());
if (localChatTab)
@@ -198,7 +199,7 @@ public:
}
mConfirmDialog = nullptr;
}
- else if (event.getId() == "~yes")
+ else if (eventId == "~yes")
{
mConfirmDialog = nullptr;
}
@@ -345,7 +346,8 @@ public:
void action(const gcn::ActionEvent &event)
{
- if (event.getId() == "do invite")
+ const std::string &eventId = event.getId();
+ if (eventId == "do invite")
{
std::string name = mInviteDialog->getText();
Net::getPartyHandler()->invite(name);
@@ -357,11 +359,11 @@ public:
}
mInviteDialog = nullptr;
}
- else if (event.getId() == "~do invite")
+ else if (eventId == "~do invite")
{
mInviteDialog = nullptr;
}
- else if (event.getId() == "yes")
+ else if (eventId == "yes")
{
Net::getPartyHandler()->leave();
if (localChatTab)
@@ -371,7 +373,7 @@ public:
}
mConfirmDialog = nullptr;
}
- else if (event.getId() == "~yes")
+ else if (eventId == "~yes")
{
mConfirmDialog = nullptr;
}
@@ -1487,7 +1489,7 @@ void SocialWindow::action(const gcn::ActionEvent &event)
mGuildInvited = 0;
mGuildAcceptDialog = nullptr;
}
- else if (event.getId() == "create")
+ else if (eventId == "create")
{
if (Net::getGuildHandler()->isSupported())
{
@@ -1499,17 +1501,17 @@ void SocialWindow::action(const gcn::ActionEvent &event)
showPartyCreate();
}
}
- else if (event.getId() == "invite" && mTabs->getSelectedTabIndex() > -1)
+ else if (eventId == "invite" && mTabs->getSelectedTabIndex() > -1)
{
if (mTabs->getSelectedTab())
static_cast<SocialTab*>(mTabs->getSelectedTab())->invite();
}
- else if (event.getId() == "leave" && mTabs->getSelectedTabIndex() > -1)
+ else if (eventId == "leave" && mTabs->getSelectedTabIndex() > -1)
{
if (mTabs->getSelectedTab())
static_cast<SocialTab*>(mTabs->getSelectedTab())->leave();
}
- else if (event.getId() == "create guild")
+ else if (eventId == "create guild")
{
std::string name = mGuildCreateDialog->getText();
@@ -1528,11 +1530,11 @@ void SocialWindow::action(const gcn::ActionEvent &event)
mGuildCreateDialog = nullptr;
}
- else if (event.getId() == "~create guild")
+ else if (eventId == "~create guild")
{
mGuildCreateDialog = nullptr;
}
- else if (event.getId() == "create party")
+ else if (eventId == "create party")
{
std::string name = mPartyCreateDialog->getText();
@@ -1551,7 +1553,7 @@ void SocialWindow::action(const gcn::ActionEvent &event)
mPartyCreateDialog = nullptr;
}
- else if (event.getId() == "~create party")
+ else if (eventId == "~create party")
{
mPartyCreateDialog = nullptr;
}