diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-06-02 01:50:47 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-06-02 01:50:47 +0000 |
| commit | 87bc8b43600937a3d83cbdf8345e23a484755e3a (patch) | |
| tree | 661131614ed841f68ab8cc23ea372983d49fbe20 /pokemod/Pokemod.cpp | |
| parent | f3e081acd87439efadd5ff4181916e06cc07f051 (diff) | |
| download | sigen-87bc8b43600937a3d83cbdf8345e23a484755e3a.tar.gz sigen-87bc8b43600937a3d83cbdf8345e23a484755e3a.tar.xz sigen-87bc8b43600937a3d83cbdf8345e23a484755e3a.zip | |
[FIX] Modified Rules a bit
[FIX] Updated Rules widget to match up with Rules
[FIX] Reorganized the Rules widget
[FIX] Using KStandardDirs rather than hardcoded ones
[FIX] Cleaned up some minor things with KListWidgets
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@188 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemod/Pokemod.cpp')
| -rw-r--r-- | pokemod/Pokemod.cpp | 54 |
1 files changed, 24 insertions, 30 deletions
diff --git a/pokemod/Pokemod.cpp b/pokemod/Pokemod.cpp index 88d244dc..2d5b4d77 100644 --- a/pokemod/Pokemod.cpp +++ b/pokemod/Pokemod.cpp @@ -109,23 +109,20 @@ void Pokemod::validate() QSet<int> idChecker; QSet<QString> nameChecker; QSet<int> timeChecker; - if (m_rules->abilityAllowed()) + if (abilityCount() < m_rules->maxAbilities()) + emit(error("There are too few abilities")); + foreach (Ability* ability, m_abilities) { - if (!abilityCount()) - emit(error("There are no abilities")); - foreach (Ability* ability, m_abilities) - { - ability->validate(); - if (idChecker.contains(ability->id())) - emit(error(subclass("ability", ability->id()))); - idChecker.insert(ability->id()); - if (nameChecker.contains(ability->name())) - emit(error(subclass("ability", ability->name()))); - nameChecker.insert(ability->name()); - } - idChecker.clear(); - nameChecker.clear(); + ability->validate(); + if (idChecker.contains(ability->id())) + emit(error(subclass("ability", ability->id()))); + idChecker.insert(ability->id()); + if (nameChecker.contains(ability->name())) + emit(error(subclass("ability", ability->name()))); + nameChecker.insert(ability->name()); } + idChecker.clear(); + nameChecker.clear(); if (!authorCount()) emit(error("There are no authors")); foreach (Author* author, m_authors) @@ -255,23 +252,20 @@ void Pokemod::validate() } idChecker.clear(); nameChecker.clear(); - if (m_rules->natureAllowed()) + if (natureCount() < m_rules->maxNatures()) + emit(error("There are too few natures")); + foreach (Nature* nature, m_natures) { - if (!natureCount()) - emit(error("There are no natures")); - foreach (Nature* nature, m_natures) - { - nature->validate(); - if (idChecker.contains(nature->id())) - emit(error(subclass("ability", nature->id()))); - idChecker.insert(nature->id()); - if (nameChecker.contains(nature->name())) - emit(error(subclass("nature", nature->name()))); - nameChecker.insert(nature->name()); - } - idChecker.clear(); - nameChecker.clear(); + nature->validate(); + if (idChecker.contains(nature->id())) + emit(error(subclass("ability", nature->id()))); + idChecker.insert(nature->id()); + if (nameChecker.contains(nature->name())) + emit(error(subclass("nature", nature->name()))); + nameChecker.insert(nature->name()); } + idChecker.clear(); + nameChecker.clear(); if (!soundCount()) emit(error("There are no sounds")); foreach (Sound* sound, m_sounds) |
