diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-12 20:30:46 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-12 20:31:24 +0200 |
commit | c6a2f58d221247456946100082a580cce9733917 (patch) | |
tree | 36c3f43d1ea5973537613cf761a3300689c5d31b /src/gui/partywindow.cpp | |
parent | 057c4592a0260af3efca3f7871abf24d8ed77c5d (diff) | |
download | mana-c6a2f58d221247456946100082a580cce9733917.tar.gz mana-c6a2f58d221247456946100082a580cce9733917.tar.bz2 mana-c6a2f58d221247456946100082a580cce9733917.tar.xz mana-c6a2f58d221247456946100082a580cce9733917.zip |
Some small cleanups and fixed compile with tmwserv support
Diffstat (limited to 'src/gui/partywindow.cpp')
-rw-r--r-- | src/gui/partywindow.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gui/partywindow.cpp b/src/gui/partywindow.cpp index 52a7b97e..317811ee 100644 --- a/src/gui/partywindow.cpp +++ b/src/gui/partywindow.cpp @@ -65,7 +65,7 @@ PartyWindow::~PartyWindow() delete_all(mMembers); } -void PartyWindow::setPartyName(std::string name) +void PartyWindow::setPartyName(const std::string &name) { setCaption(strprintf(_("Party (%s)"), name.c_str())); } @@ -125,8 +125,7 @@ void PartyWindow::updateMember(int id, const std::string &memberName, member->avatar->setName(memberName); member->avatar->setOnline(online); - Player *player = dynamic_cast<Player*>(beingManager->findBeing(id)); - if (player) + if (Player *player = dynamic_cast<Player*>(beingManager->findBeing(id))) player->setInParty(true); } @@ -141,8 +140,7 @@ void PartyWindow::removeMember(int id) { mMembers.erase(id); - Player *player = dynamic_cast<Player*>(beingManager->findBeing(id)); - if (player) + if (Player *player = dynamic_cast<Player*>(beingManager->findBeing(id))) player->setInParty(false); } @@ -210,7 +208,7 @@ void PartyWindow::action(const gcn::ActionEvent &event) } } -void clearMembersSub(std::pair<int, PartyMember*> p) +void clearMembersSub(const std::pair<int, PartyMember*> &p) { Player *player = dynamic_cast<Player*>(beingManager->findBeing(p.first)); if (player) |