diff options
Diffstat (limited to 'sigmodr/tree/SigmodModel.cpp')
-rw-r--r-- | sigmodr/tree/SigmodModel.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/sigmodr/tree/SigmodModel.cpp b/sigmodr/tree/SigmodModel.cpp index 3956a754..5d9b75ac 100644 --- a/sigmodr/tree/SigmodModel.cpp +++ b/sigmodr/tree/SigmodModel.cpp @@ -16,7 +16,7 @@ */ // Header include -#include "SigmodModel.h" +#include "GameModel.h" // Sigmodr tree includes #include "AbilityGroupModel.h" @@ -44,29 +44,29 @@ #include "WeatherGroupModel.h" // Sigmodr widget includes -#include <sigmodr/widgets/SigmodUI.h> +#include <sigmodr/widgets/GameUI.h> // Sigmod includes -#include <sigmod/Sigmod.h> +#include <sigmod/Game.h> // KDE includes #include <KMenu> -Sigmodr::Tree::SigmodModel::SigmodModel(BaseModel* parent, Sigmod::Sigmod* sigmod) : - GroupObjectModel(parent, sigmod) +Sigmodr::Tree::GameModel::GameModel(BaseModel* parent, Sigmod::Game* game) : + GroupObjectModel(parent, game) { setupData(); } -Sigmodr::Tree::SigmodModel::~SigmodModel() +Sigmodr::Tree::GameModel::~GameModel() { clearData(); } -QVariant Sigmodr::Tree::SigmodModel::data(int role) const +QVariant Sigmodr::Tree::GameModel::data(int role) const { if (role == Qt::DisplayRole) - return qobject_cast<Sigmod::Sigmod*>(m_object)->title(); + return qobject_cast<Sigmod::Game*>(m_object)->title(); else if (role == BaseModel::XmlRole) { QDomDocument xml(m_object->className()); @@ -75,7 +75,7 @@ QVariant Sigmodr::Tree::SigmodModel::data(int role) const } else if (role == BaseModel::WidgetRole) { - QWidget* widget = new SigmodUI(qobject_cast<Sigmod::Sigmod*>(m_object), NULL); + QWidget* widget = new SigmodUI(qobject_cast<Sigmod::Game*>(m_object), NULL); return QVariant::fromValue(widget); } else if (role == BaseModel::ContextMenuRole) @@ -86,7 +86,7 @@ QVariant Sigmodr::Tree::SigmodModel::data(int role) const return GroupObjectModel::data(role); } -bool Sigmodr::Tree::SigmodModel::setData(const QVariant& value, int role) +bool Sigmodr::Tree::GameModel::setData(const QVariant& value, int role) { if (role == BaseModel::XmlRole) { @@ -115,49 +115,49 @@ bool Sigmodr::Tree::SigmodModel::setData(const QVariant& value, int role) return false; } -QString Sigmodr::Tree::SigmodModel::types() const +QString Sigmodr::Tree::GameModel::types() const { return type().append(QString(";Rules;Ability;Author;Badge;CoinList;EggGroup;GlobalScript;Item;ItemType;Map;Move;Nature;Skin;Sound;Species;Sprite;Status;Store;Tile;Time;Trainer;Type;Weather")); } -void Sigmodr::Tree::SigmodModel::addObject(Sigmod::Object* object) +void Sigmodr::Tree::GameModel::addObject(Sigmod::Object* object) { Q_UNUSED(object) } -void Sigmodr::Tree::SigmodModel::deleteObject(BaseModel* model) +void Sigmodr::Tree::GameModel::deleteObject(BaseModel* model) { Q_UNUSED(model) } -void Sigmodr::Tree::SigmodModel::deleteSelf() +void Sigmodr::Tree::GameModel::deleteSelf() { } -void Sigmodr::Tree::SigmodModel::setupData() +void Sigmodr::Tree::GameModel::setupData() { - Sigmod::Sigmod* sigmod = qobject_cast<Sigmod::Sigmod*>(m_object); - addChild(new RulesModel(this, sigmod->rules())); - addChild(new AbilityGroupModel(this, sigmod)); - addChild(new AuthorGroupModel(this, sigmod)); - addChild(new BadgeGroupModel(this, sigmod)); - addChild(new CoinListGroupModel(this, sigmod)); - addChild(new EggGroupGroupModel(this, sigmod)); - addChild(new GlobalScriptGroupModel(this, sigmod)); - addChild(new ItemGroupModel(this, sigmod)); - addChild(new ItemTypeGroupModel(this, sigmod)); - addChild(new MapGroupModel(this, sigmod)); - addChild(new MoveGroupModel(this, sigmod)); - addChild(new NatureGroupModel(this, sigmod)); - addChild(new SkinGroupModel(this, sigmod)); - addChild(new SoundGroupModel(this, sigmod)); - addChild(new SpeciesGroupModel(this, sigmod)); - addChild(new SpriteGroupModel(this, sigmod)); - addChild(new StatusGroupModel(this, sigmod)); - addChild(new StoreGroupModel(this, sigmod)); - addChild(new TileGroupModel(this, sigmod)); - addChild(new TimeGroupModel(this, sigmod)); - addChild(new TrainerGroupModel(this, sigmod)); - addChild(new TypeGroupModel(this, sigmod)); - addChild(new WeatherGroupModel(this, sigmod)); + Sigmod::Game* game = qobject_cast<Sigmod::Game*>(m_object); + addChild(new RulesModel(this, game->rules())); + addChild(new AbilityGroupModel(this, game)); + addChild(new AuthorGroupModel(this, game)); + addChild(new BadgeGroupModel(this, game)); + addChild(new CoinListGroupModel(this, game)); + addChild(new EggGroupGroupModel(this, game)); + addChild(new GlobalScriptGroupModel(this, game)); + addChild(new ItemGroupModel(this, game)); + addChild(new ItemTypeGroupModel(this, game)); + addChild(new MapGroupModel(this, game)); + addChild(new MoveGroupModel(this, game)); + addChild(new NatureGroupModel(this, game)); + addChild(new SkinGroupModel(this, game)); + addChild(new SoundGroupModel(this, game)); + addChild(new SpeciesGroupModel(this, game)); + addChild(new SpriteGroupModel(this, game)); + addChild(new StatusGroupModel(this, game)); + addChild(new StoreGroupModel(this, game)); + addChild(new TileGroupModel(this, game)); + addChild(new TimeGroupModel(this, game)); + addChild(new TrainerGroupModel(this, game)); + addChild(new TypeGroupModel(this, game)); + addChild(new WeatherGroupModel(this, game)); } |