diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-04-29 03:24:07 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-04-29 03:24:07 +0000 |
| commit | 735fb908c4a6d912ff5a72889ce817224ad4ffdf (patch) | |
| tree | 924dde6e15ac8916e4d77986df556209e150696c /pokemodr/models/RootModel.cpp | |
| parent | 40d6f3579a23c50a5570de3f511a407924703ec1 (diff) | |
| download | sigen-735fb908c4a6d912ff5a72889ce817224ad4ffdf.tar.gz sigen-735fb908c4a6d912ff5a72889ce817224ad4ffdf.tar.xz sigen-735fb908c4a6d912ff5a72889ce817224ad4ffdf.zip | |
[FIX] Organized some more model code
[ADD] Added AbilityGroupModel class
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@116 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/models/RootModel.cpp')
| -rw-r--r-- | pokemodr/models/RootModel.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/pokemodr/models/RootModel.cpp b/pokemodr/models/RootModel.cpp index 851286d1..a0a237f8 100644 --- a/pokemodr/models/RootModel.cpp +++ b/pokemodr/models/RootModel.cpp @@ -30,14 +30,7 @@ RootModel::RootModel(const QList<QVariant>& pokemods) : GroupModel(NULL, NULL) { - QFile fin("full.pmod"); - fin.open(QIODevice::ReadOnly); - QDomDocument xml; - xml.setContent(&fin); - fin.close(); - m_objects.append(new PokemodModel(this, new Pokemod(xml.documentElement()))); - m_objects.append(new PokemodModel(this, new Pokemod(xml.documentElement()))); - // TODO: make sub models from data + setupData(); } RootModel::~RootModel() @@ -65,3 +58,21 @@ bool RootModel::removeRows(const int position, const int rows) } return true; } + +void RootModel::setupData() +{ + setupData(QList<QVariant>()); +} + + +void RootModel::setupData(const QList<QVariant>& pokemods) +{ + QFile fin("full.pmod"); + fin.open(QIODevice::ReadOnly); + QDomDocument xml; + xml.setContent(&fin); + fin.close(); + m_objects.append(new PokemodModel(this, new Pokemod(xml.documentElement()))); + m_objects.append(new PokemodModel(this, new Pokemod(xml.documentElement()))); + // TODO: make sub models from data +} |
