diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-06-13 13:16:16 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-06-13 13:16:16 -0600 |
commit | e8bea8a6edf69e824a922adeb5e697111ceabe90 (patch) | |
tree | db1937956bc585b300f2a2c8312af4ad5bf924de /src/gui/setup_players.cpp | |
parent | 593fd2b831304c8e421589aab0fb158e4b7e9c35 (diff) | |
parent | 0b15a3ad32838134384524ce4af95d65b0b4e5da (diff) | |
download | mana-e8bea8a6edf69e824a922adeb5e697111ceabe90.tar.gz mana-e8bea8a6edf69e824a922adeb5e697111ceabe90.tar.bz2 mana-e8bea8a6edf69e824a922adeb5e697111ceabe90.tar.xz mana-e8bea8a6edf69e824a922adeb5e697111ceabe90.zip |
Merge remote branch '1.0/1.0'
Conflicts:
data/graphics/CMakeLists.txt
data/graphics/Makefile.am
src/client.cpp
Diffstat (limited to 'src/gui/setup_players.cpp')
-rw-r--r-- | src/gui/setup_players.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp index 15cc787a..f7a39240 100644 --- a/src/gui/setup_players.cpp +++ b/src/gui/setup_players.cpp @@ -35,6 +35,7 @@ #include "gui/widgets/scrollarea.h" #include "gui/widgets/table.h" +#include "utils/dtor.h" #include "utils/gettext.h" #include <string> @@ -88,7 +89,8 @@ class PlayerTableModel : public TableModel { public: PlayerTableModel() : - mPlayers(NULL) + mPlayers(NULL), + mListModel(new PlayerRelationListModel) { playerRelationsUpdated(); } @@ -96,6 +98,7 @@ public: virtual ~PlayerTableModel() { freeWidgets(); + delete mListModel; if (mPlayers) delete mPlayers; } @@ -139,9 +142,8 @@ public: std::string name = (*player_names)[r]; gcn::Widget *widget = new Label(name); mWidgets.push_back(widget); - gcn::ListModel *playerRelation = new PlayerRelationListModel; - gcn::DropDown *choicebox = new DropDown(playerRelation); + gcn::DropDown *choicebox = new DropDown(mListModel); choicebox->setSelected(player_relations.getRelation(name)); mWidgets.push_back(choicebox); } @@ -170,12 +172,7 @@ public: delete mPlayers; mPlayers = NULL; - for (std::vector<gcn::Widget *>::const_iterator it = mWidgets.begin(); - it != mWidgets.end(); it++) - { - delete *it; - } - + delete_all(mWidgets); mWidgets.clear(); } @@ -187,6 +184,7 @@ public: protected: std::vector<std::string> *mPlayers; std::vector<gcn::Widget *> mWidgets; + PlayerRelationListModel *mListModel; }; /** |