diff options
Diffstat (limited to 'sigmodr/tree/TrainerGroupModel.cpp')
-rw-r--r-- | sigmodr/tree/TrainerGroupModel.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sigmodr/tree/TrainerGroupModel.cpp b/sigmodr/tree/TrainerGroupModel.cpp index ad78051b..1799a8eb 100644 --- a/sigmodr/tree/TrainerGroupModel.cpp +++ b/sigmodr/tree/TrainerGroupModel.cpp @@ -22,17 +22,17 @@ #include "TrainerModel.h" // Sigmod includes -#include <sigmod/Sigmod.h> +#include <sigmod/Game.h> #include <sigmod/Trainer.h> // KDE includes #include <KMenu> -Sigmodr::Tree::TrainerGroupModel::TrainerGroupModel(BaseModel* parent, Sigmod::Sigmod* sigmod) : - GroupModel(parent, sigmod, "Trainers") +Sigmodr::Tree::TrainerGroupModel::TrainerGroupModel(BaseModel* parent, Sigmod::Game* game) : + GroupModel(parent, game, "Trainers") { - for (int i = 0; i < sigmod->trainerCount(); ++i) - addObject(sigmod->trainer(i)); + for (int i = 0; i < game->trainerCount(); ++i) + addObject(game->trainer(i)); } QVariant Sigmodr::Tree::TrainerGroupModel::data(const int role) const @@ -56,7 +56,7 @@ bool Sigmodr::Tree::TrainerGroupModel::setData(const QVariant& value, int role) QDomDocument xml; if (loadFromData(data, &xml) && (xml.doctype().name() == "Trainer")) { - addObject(qobject_cast<Sigmod::Sigmod*>(m_object)->newTrainer(xml.documentElement())); + addObject(qobject_cast<Sigmod::Game*>(m_object)->newTrainer(xml.documentElement())); return true; } } @@ -72,7 +72,7 @@ QString Sigmodr::Tree::TrainerGroupModel::types() const void Sigmodr::Tree::TrainerGroupModel::addObject(Sigmod::Object* object) { if (!object) - object = qobject_cast<Sigmod::Sigmod*>(m_object)->newTrainer(); + object = qobject_cast<Sigmod::Game*>(m_object)->newTrainer(); if (object->className() == "Trainer") addChild(new TrainerModel(this, qobject_cast<Sigmod::Trainer*>(object))); } @@ -82,7 +82,7 @@ void Sigmodr::Tree::TrainerGroupModel::deleteObject(BaseModel* model) const int index = find(model); if (0 <= index) { - qobject_cast<Sigmod::Sigmod*>(m_object)->deleteTrainer(index); + qobject_cast<Sigmod::Game*>(m_object)->deleteTrainer(index); m_objects[index]->deleteLater(); m_objects.removeAt(index); childRowChanged(index); |