summaryrefslogtreecommitdiffstats
path: root/pokemodr/models/CoinListObjectModel.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-04-29 07:55:55 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-04-29 07:55:55 +0000
commita9975096cc39198c07564bd2c12b5da6e0fc2875 (patch)
tree53a856ebf891cc5440891c57c1daf6087a7021b8 /pokemodr/models/CoinListObjectModel.cpp
parent735fb908c4a6d912ff5a72889ce817224ad4ffdf (diff)
downloadsigen-a9975096cc39198c07564bd2c12b5da6e0fc2875.tar.gz
sigen-a9975096cc39198c07564bd2c12b5da6e0fc2875.tar.xz
sigen-a9975096cc39198c07564bd2c12b5da6e0fc2875.zip
[FIX] QStringList needed in some of the pokemod headers
[ADD] Rest of the model classes [FIX] Small bugfixes within the models git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@117 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/models/CoinListObjectModel.cpp')
-rw-r--r--pokemodr/models/CoinListObjectModel.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/pokemodr/models/CoinListObjectModel.cpp b/pokemodr/models/CoinListObjectModel.cpp
index ffe860c1..7b520a2f 100644
--- a/pokemodr/models/CoinListObjectModel.cpp
+++ b/pokemodr/models/CoinListObjectModel.cpp
@@ -28,7 +28,6 @@
#include "../../pokemod/Species.h"
// Qt includes
-#include <QDomDocument>
#include <QFile>
CoinListObjectModel::CoinListObjectModel(BaseModel* parent, CoinListObject* object) :
@@ -46,9 +45,17 @@ QVariant CoinListObjectModel::data(int role) const
{
CoinListObject* object = static_cast<CoinListObject*>(m_object);
if (object->type() == CoinListObject::Item)
- return static_cast<const Pokemod*>(m_object->pokemod())->item(object->object())->name();
+ {
+ const Item* item = static_cast<const Pokemod*>(m_object->pokemod())->itemById(object->object());
+ if (item)
+ return item->name();
+ }
else if (object->type() == CoinListObject::Species)
- return static_cast<const Pokemod*>(m_object->pokemod())->species(object->object())->name();
+ {
+ const Species* species = static_cast<const Pokemod*>(m_object->pokemod())->speciesById(object->object());
+ if (species)
+ return species->name();
+ }
}
else if (role == BaseModel::XmlRole)
{