diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-05-23 19:17:53 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-05-23 19:17:53 +0000 |
| commit | 793f2e539316e796968103617025320870f8c3ce (patch) | |
| tree | f702d6498d3c0841b05a07bc129d34a12b09625e /pokemodr/models/MoveEffectModel.cpp | |
| parent | c07a81f2656d1168e7124f0b7281a4e38128926b (diff) | |
| download | sigen-793f2e539316e796968103617025320870f8c3ce.tar.gz sigen-793f2e539316e796968103617025320870f8c3ce.tar.xz sigen-793f2e539316e796968103617025320870f8c3ce.zip | |
[DEL] Cleaned out unneeded files
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@167 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/models/MoveEffectModel.cpp')
| -rw-r--r-- | pokemodr/models/MoveEffectModel.cpp | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/pokemodr/models/MoveEffectModel.cpp b/pokemodr/models/MoveEffectModel.cpp deleted file mode 100644 index fcb0fb00..00000000 --- a/pokemodr/models/MoveEffectModel.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2008 Ben Boeckel <MathStuf@gmail.com> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -// Header include -#include "MoveEffectModel.h" - -// PokeModr includes -// #include "../MoveEffectUI.h" - -// Pokemod includes -#include "../../pokemod/Move.h" -#include "../../pokemod/MoveEffect.h" - -// Qt includes -#include <QFile> - -MoveEffectModel::MoveEffectModel(BaseModel* parent, MoveEffect* effect) : - ObjectModel(parent, effect) -{ -} - -MoveEffectModel::~MoveEffectModel() -{ -} - -QVariant MoveEffectModel::data(int role) const -{ - if (role == Qt::DisplayRole) - { - if (static_cast<MoveEffect*>(m_object)->effect() < MoveEffect::E_End_Overworld) - return MoveEffect::EffectStr[static_cast<MoveEffect*>(m_object)->effect()]; - return ""; - } - else if (role == BaseModel::XmlRole) - { - QDomDocument xml(m_object->className()); - xml.appendChild(m_object->save()); - return xml.toString(); - } - else if (role == BaseModel::WidgetRole) - { - // TODO: MoveEffectUI -// QWidget* widget = new MoveEffectUI(static_cast<MoveEffect*>(m_object), NULL); -// return QVariant::fromValue(widget); - } - return ObjectModel::data(role); -} - -bool MoveEffectModel::setData(const QVariant& value, int role) -{ - if (role == BaseModel::XmlRole) - { - if (value.canConvert<QString>()) - { - QFile file(value.toString()); - QDomDocument xml; - if ((file.open(QIODevice::ReadOnly) && xml.setContent(&file)) || xml.setContent(value.toString())) - { - if (xml.doctype().name() == m_object->className()) - { - m_object->load(xml.documentElement()); - return true; - } - file.close(); - } - } - } - return false; -} |
