diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-04-30 16:57:31 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-04-30 16:57:31 +0200 |
commit | 908dceb882723460cde35ec8ef22927b702ab874 (patch) | |
tree | 0598a9cb5d720c66c619fd350d64453490b35143 /src/gui/skilldialog.cpp | |
parent | 8a67e721880959b431d220e2d1fd5b60a4f11ad7 (diff) | |
parent | 0b1c6eb3c4941dc2d47ad3207bab4509ae1014cc (diff) | |
download | mana-908dceb882723460cde35ec8ef22927b702ab874.tar.gz mana-908dceb882723460cde35ec8ef22927b702ab874.tar.bz2 mana-908dceb882723460cde35ec8ef22927b702ab874.tar.xz mana-908dceb882723460cde35ec8ef22927b702ab874.zip |
Merge branch '0.5'
Conflicts:
CMakeLists.txt
po/fi.po
po/fr.po
src/gui/skilldialog.cpp
src/localplayer.cpp
src/net/manaserv/generalhandler.cpp
src/net/tmwa/buysellhandler.cpp
src/net/tmwa/generalhandler.cpp
src/net/tmwa/playerhandler.cpp
src/net/tmwa/specialhandler.cpp
src/winver.h
Diffstat (limited to 'src/gui/skilldialog.cpp')
-rw-r--r-- | src/gui/skilldialog.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index c7976caa..19bd06d6 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -56,6 +56,8 @@ #include <set> #include <string> +#define SKILLS_FILE "skills.xml" + class SkillModel; class SkillEntry; @@ -235,8 +237,7 @@ SkillDialog::SkillDialog(): SkillDialog::~SkillDialog() { - // Clear gui - loadSkills(""); + clearSkills(); } void SkillDialog::action(const gcn::ActionEvent &event) @@ -291,7 +292,7 @@ void SkillDialog::event(Event::Channel channel, const Event &event) } } -void SkillDialog::loadSkills(const std::string &file) +void SkillDialog::clearSkills() { // Fixes issues with removing tabs if (mTabs->getSelectedTabIndex() != -1) @@ -308,11 +309,13 @@ void SkillDialog::loadSkills(const std::string &file) delete_all(mSkills); mSkills.clear(); +} - if (file.length() == 0) - return; +void SkillDialog::loadSkills() +{ + clearSkills(); - XML::Document doc(file); + XML::Document doc(SKILLS_FILE); xmlNodePtr root = doc.rootNode(); int setCount = 0; @@ -323,7 +326,7 @@ void SkillDialog::loadSkills(const std::string &file) if (!root || !xmlStrEqual(root->name, BAD_CAST "skills")) { - logger->log("Error loading skills file: %s", file.c_str()); + logger->log("Error loading skills file: %s", SKILLS_FILE); if (Net::getNetworkType() == ServerInfo::TMWATHENA) { |