summaryrefslogtreecommitdiffstats
path: root/pokemodr/models/CoinListObjectModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemodr/models/CoinListObjectModel.cpp')
-rw-r--r--pokemodr/models/CoinListObjectModel.cpp35
1 files changed, 18 insertions, 17 deletions
diff --git a/pokemodr/models/CoinListObjectModel.cpp b/pokemodr/models/CoinListObjectModel.cpp
index 996378a5..8e86767c 100644
--- a/pokemodr/models/CoinListObjectModel.cpp
+++ b/pokemodr/models/CoinListObjectModel.cpp
@@ -21,13 +21,14 @@
// Model includes
#include "GroupObjectModel.h"
-// PokeModr includes
+// Pokemodr includes
#include "../CoinListObjectUI.h"
// Pokemod includes
#include "../../pokemod/CoinList.h"
#include "../../pokemod/CoinListObject.h"
#include "../../pokemod/Item.h"
+#include "../../pokemod/Pokemod.h"
#include "../../pokemod/Species.h"
// Qt includes
@@ -36,57 +37,57 @@
// KDE includes
#include <KMenu>
-CoinListObjectModel::CoinListObjectModel(BaseModel* parent, CoinListObject* object) :
+Pokemodr::CoinListObjectModel::CoinListObjectModel(BaseModel* parent, Pokemod::CoinListObject* object) :
ObjectModel(parent, object)
{
}
-CoinListObjectModel::~CoinListObjectModel()
+Pokemodr::CoinListObjectModel::~CoinListObjectModel()
{
}
-QVariant CoinListObjectModel::data(int role) const
+QVariant Pokemodr::CoinListObjectModel::data(int role) const
{
if (role == Qt::DisplayRole)
{
- CoinListObject* object = static_cast<CoinListObject*>(m_object);
- if (object->type() == CoinListObject::Item)
+ Pokemod::CoinListObject* object = static_cast<Pokemod::CoinListObject*>(m_object);
+ if (object->type() == Pokemod::CoinListObject::Item)
{
- const Item* item = static_cast<const Pokemod*>(m_object->pokemod())->itemById(object->object());
+ const Pokemod::Item* item = static_cast<const Pokemod::Pokemod*>(m_object->pokemod())->itemById(object->object());
if (item)
return item->name();
}
- else if (object->type() == CoinListObject::Species)
+ else if (object->type() == Pokemod::CoinListObject::Species)
{
- const Species* species = static_cast<const Pokemod*>(m_object->pokemod())->speciesById(object->object());
+ const Pokemod::Species* species = static_cast<const Pokemod::Pokemod*>(m_object->pokemod())->speciesById(object->object());
if (species)
return species->name();
}
return "";
}
- else if (role == BaseModel::XmlRole)
+ else if (role == Pokemodr::BaseModel::XmlRole)
{
QDomDocument xml(m_object->className());
xml.appendChild(m_object->save());
return xml.toString();
}
- else if (role == BaseModel::WidgetRole)
+ else if (role == Pokemodr::BaseModel::WidgetRole)
{
- QWidget* widget = new CoinListObjectUI(static_cast<CoinListObject*>(m_object), NULL);
+ QWidget* widget = new CoinListObjectUI(static_cast<Pokemod::CoinListObject*>(m_object), NULL);
return QVariant::fromValue(widget);
}
- else if (role == BaseModel::ContextMenuRole)
+ else if (role == Pokemodr::BaseModel::ContextMenuRole)
{
KMenu* menu = new KMenu;
menu->addAction("Delete Object", this, SLOT(deleteSelf()));
return QVariant::fromValue(static_cast<void*>(menu));
}
- return ObjectModel::data(role);
+ return Pokemodr::ObjectModel::data(role);
}
-bool CoinListObjectModel::setData(const QVariant& value, int role)
+bool Pokemodr::CoinListObjectModel::setData(const QVariant& value, int role)
{
- if (role == BaseModel::XmlRole)
+ if (role == Pokemodr::BaseModel::XmlRole)
{
if (value.canConvert<QString>())
{
@@ -106,7 +107,7 @@ bool CoinListObjectModel::setData(const QVariant& value, int role)
return false;
}
-void CoinListObjectModel::deleteSelf()
+void Pokemodr::CoinListObjectModel::deleteSelf()
{
// static_cast<GroupObjectModel*>(m_parent)->deleteObject(this);
}