summaryrefslogtreecommitdiffstats
path: root/pokemodr/models/RootModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemodr/models/RootModel.cpp')
-rw-r--r--pokemodr/models/RootModel.cpp27
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
+}