summaryrefslogtreecommitdiffstats
path: root/sigmodr/models/CoinListModel.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-09-06 04:12:30 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-09-06 04:12:30 +0000
commit0b4b89cf8efdc15e5a8d4b6cb24a5c8a025227d9 (patch)
treea2031b9d0016fcbd49a51c0d1a2292d1f2d8b566 /sigmodr/models/CoinListModel.cpp
parentb81f5bffa2772eb9bd3c67fb35485ab1ee2d96e7 (diff)
downloadsigen-0b4b89cf8efdc15e5a8d4b6cb24a5c8a025227d9.tar.gz
sigen-0b4b89cf8efdc15e5a8d4b6cb24a5c8a025227d9.tar.xz
sigen-0b4b89cf8efdc15e5a8d4b6cb24a5c8a025227d9.zip
[FIX] Renamed everything (in use) away from Poké- prefixes
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@250 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'sigmodr/models/CoinListModel.cpp')
-rw-r--r--sigmodr/models/CoinListModel.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/sigmodr/models/CoinListModel.cpp b/sigmodr/models/CoinListModel.cpp
index a586defa..8729e652 100644
--- a/sigmodr/models/CoinListModel.cpp
+++ b/sigmodr/models/CoinListModel.cpp
@@ -21,12 +21,12 @@
// Model includes
#include "CoinListObjectModel.h"
-// Pokemodr includes
+// Sigmodr includes
#include "../CoinListUI.h"
-// Pokemod includes
-#include "../../pokemod/CoinList.h"
-#include "../../pokemod/CoinListObject.h"
+// Sigmod includes
+#include "../../sigmod/CoinList.h"
+#include "../../sigmod/CoinListObject.h"
// Qt includes
#include <QtCore/QFile>
@@ -34,33 +34,33 @@
// KDE includes
#include <KMenu>
-Pokemodr::CoinListModel::CoinListModel(BaseModel* parent, Pokemod::CoinList* coinList) :
+Sigmodr::CoinListModel::CoinListModel(BaseModel* parent, Sigmod::CoinList* coinList) :
GroupObjectModel(parent, coinList)
{
setupData();
}
-Pokemodr::CoinListModel::~CoinListModel()
+Sigmodr::CoinListModel::~CoinListModel()
{
clearData();
}
-QVariant Pokemodr::CoinListModel::data(int role) const
+QVariant Sigmodr::CoinListModel::data(int role) const
{
if (role == Qt::DisplayRole)
- return qobject_cast<Pokemod::CoinList*>(m_object)->name();
- else if (role == Pokemodr::BaseModel::XmlRole)
+ return qobject_cast<Sigmod::CoinList*>(m_object)->name();
+ else if (role == Sigmodr::BaseModel::XmlRole)
{
QDomDocument xml(m_object->className());
xml.appendChild(m_object->save());
return xml.toString();
}
- else if (role == Pokemodr::BaseModel::WidgetRole)
+ else if (role == Sigmodr::BaseModel::WidgetRole)
{
- QWidget* widget = new CoinListUI(qobject_cast<Pokemod::CoinList*>(m_object), NULL);
+ QWidget* widget = new CoinListUI(qobject_cast<Sigmod::CoinList*>(m_object), NULL);
return QVariant::fromValue(widget);
}
- else if (role == Pokemodr::BaseModel::ContextMenuRole)
+ else if (role == Sigmodr::BaseModel::ContextMenuRole)
{
KMenu* menu = new KMenu;
menu->addAction("&Add Object", this, SLOT(addObject()));
@@ -68,12 +68,12 @@ QVariant Pokemodr::CoinListModel::data(int role) const
menu->addAction("&Delete Coin List", this, SLOT(deleteSelf()));
return QVariant::fromValue(menu);
}
- return Pokemodr::GroupObjectModel::data(role);
+ return Sigmodr::GroupObjectModel::data(role);
}
-bool Pokemodr::CoinListModel::setData(const QVariant& value, int role)
+bool Sigmodr::CoinListModel::setData(const QVariant& value, int role)
{
- if (role == Pokemodr::BaseModel::XmlRole)
+ if (role == Sigmodr::BaseModel::XmlRole)
{
if (value.canConvert<QString>())
{
@@ -90,7 +90,7 @@ bool Pokemodr::CoinListModel::setData(const QVariant& value, int role)
}
else if (xml.doctype().name() == "CoinListObject")
{
- addObject(qobject_cast<Pokemod::CoinList*>(m_object)->newObject(xml.documentElement()));
+ addObject(qobject_cast<Sigmod::CoinList*>(m_object)->newObject(xml.documentElement()));
return true;
}
file.close();
@@ -100,33 +100,33 @@ bool Pokemodr::CoinListModel::setData(const QVariant& value, int role)
return false;
}
-void Pokemodr::CoinListModel::addObject(Pokemod::Object* object)
+void Sigmodr::CoinListModel::addObject(Sigmod::Object* object)
{
if (!object)
- object = qobject_cast<Pokemod::CoinList*>(m_object)->newObject();
+ object = qobject_cast<Sigmod::CoinList*>(m_object)->newObject();
if (object->className() == "CoinListObject")
- m_objects.append(new CoinListObjectModel(this, qobject_cast<Pokemod::CoinListObject*>(object)));
+ m_objects.append(new CoinListObjectModel(this, qobject_cast<Sigmod::CoinListObject*>(object)));
}
-void Pokemodr::CoinListModel::deleteObject(BaseModel* model)
+void Sigmodr::CoinListModel::deleteObject(BaseModel* model)
{
const int index = m_objects.indexOf(model);
if (0 <= index)
{
- qobject_cast<Pokemod::CoinList*>(m_object)->deleteObject(index);
+ qobject_cast<Sigmod::CoinList*>(m_object)->deleteObject(index);
m_objects[index]->deleteLater();
m_objects.removeAt(index);
}
}
-void Pokemodr::CoinListModel::deleteSelf()
+void Sigmodr::CoinListModel::deleteSelf()
{
// qobject_cast<GroupModel*>(m_parent)->deleteObject(this);
}
-void Pokemodr::CoinListModel::setupData()
+void Sigmodr::CoinListModel::setupData()
{
- Pokemod::CoinList* coinList = qobject_cast<Pokemod::CoinList*>(m_object);
+ Sigmod::CoinList* coinList = qobject_cast<Sigmod::CoinList*>(m_object);
for (int i = 0; i < coinList->objectCount(); ++i)
m_objects.append(new CoinListObjectModel(this, coinList->object(i)));
}