summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-08 21:13:38 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-08 21:22:43 +0100
commitddc93c461070fb3d868fbb5426e8361d1b93ee38 (patch)
tree250eacd391542d36a51c4d3aa398d4f6346619fb /src/gui
parentd129ce9776a6fd0e165b676a3addd14186c5d85d (diff)
downloadmana-ddc93c461070fb3d868fbb5426e8361d1b93ee38.tar.gz
mana-ddc93c461070fb3d868fbb5426e8361d1b93ee38.tar.bz2
mana-ddc93c461070fb3d868fbb5426e8361d1b93ee38.tar.xz
mana-ddc93c461070fb3d868fbb5426e8361d1b93ee38.zip
Introduced another template to make deleting all values in a container easier.
Inspired by qDeleteAll() from Qt. Conflicts: ChangeLog src/beingmanager.cpp src/channelmanager.cpp src/gui/skill.cpp src/map.cpp src/resources/monsterinfo.cpp (cherry picked from mainline)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/setup.cpp2
-rw-r--r--src/gui/shop.cpp4
-rw-r--r--src/gui/skill.cpp4
-rw-r--r--src/gui/windowcontainer.cpp4
4 files changed, 4 insertions, 10 deletions
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index e8e0905e..2f6c6140 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -99,7 +99,7 @@ Setup::Setup():
Setup::~Setup()
{
- for_each(mTabs.begin(), mTabs.end(), make_dtor(mTabs));
+ delete_all(mTabs);
}
void Setup::action(const gcn::ActionEvent &event)
diff --git a/src/gui/shop.cpp b/src/gui/shop.cpp
index 085e93ce..a4478a62 100644
--- a/src/gui/shop.cpp
+++ b/src/gui/shop.cpp
@@ -23,8 +23,6 @@
#include "../utils/dtor.h"
-#include <algorithm>
-
ShopItems::~ShopItems()
{
clear();
@@ -59,7 +57,7 @@ ShopItem* ShopItems::at(int i) const
void ShopItems::clear()
{
- std::for_each(mShopItems.begin(), mShopItems.end(), make_dtor(mShopItems));
+ delete_all(mShopItems);
mShopItems.clear();
}
diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp
index cadde0b9..1b7466ff 100644
--- a/src/gui/skill.cpp
+++ b/src/gui/skill.cpp
@@ -19,8 +19,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <algorithm>
-
#include <guichan/widgets/label.hpp>
#include "skill.h"
@@ -248,7 +246,7 @@ void SkillDialog::setSkill(int id, int lvl, int mp)
void SkillDialog::cleanList()
{
- for_each(mSkillList.begin(), mSkillList.end(), make_dtor(mSkillList));
+ delete_all(mSkillList);
mSkillList.clear();
}
diff --git a/src/gui/windowcontainer.cpp b/src/gui/windowcontainer.cpp
index f92e8388..d8535f73 100644
--- a/src/gui/windowcontainer.cpp
+++ b/src/gui/windowcontainer.cpp
@@ -19,15 +19,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <algorithm>
-
#include "windowcontainer.h"
#include "../utils/dtor.h"
void WindowContainer::logic()
{
- for_each(mDeathList.begin(), mDeathList.end(), make_dtor(mDeathList));
+ delete_all(mDeathList);
mDeathList.clear();
gcn::Container::logic();