summaryrefslogtreecommitdiffstats
path: root/sigmodr/tree/MapWildListModel.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-02-28 01:08:35 -0500
committerBen Boeckel <MathStuf@gmail.com>2009-02-28 01:08:35 -0500
commitc81259d5ea3cf4659affdb51b7622c61685a82ff (patch)
tree7d00b36089fe22b1b6659b89c93d5b51e3337d09 /sigmodr/tree/MapWildListModel.cpp
parentefb2daeb653694f29e12ee09348ccf68c904cc83 (diff)
downloadsigen-c81259d5ea3cf4659affdb51b7622c61685a82ff.tar.gz
sigen-c81259d5ea3cf4659affdb51b7622c61685a82ff.tar.xz
sigen-c81259d5ea3cf4659affdb51b7622c61685a82ff.zip
Added the Sigmod namespace to the sigmodrtree sources
Diffstat (limited to 'sigmodr/tree/MapWildListModel.cpp')
-rw-r--r--sigmodr/tree/MapWildListModel.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/sigmodr/tree/MapWildListModel.cpp b/sigmodr/tree/MapWildListModel.cpp
index a795401d..adf4c23e 100644
--- a/sigmodr/tree/MapWildListModel.cpp
+++ b/sigmodr/tree/MapWildListModel.cpp
@@ -33,10 +33,11 @@
// KDE includes
#include <KMenu>
+using namespace Sigmod;
using namespace Sigmodr::Widgets;
using namespace Sigmodr::Tree;
-MapWildListModel::MapWildListModel(BaseModel* parent, Sigmod::MapWildList* wildList) :
+MapWildListModel::MapWildListModel(BaseModel* parent, MapWildList* wildList) :
GroupObjectModel(parent, wildList)
{
setupData();
@@ -51,7 +52,7 @@ QVariant MapWildListModel::data(int role) const
{
if (role == Qt::DisplayRole)
{
- return qobject_cast<Sigmod::MapWildList*>(m_object)->name();
+ return qobject_cast<MapWildList*>(m_object)->name();
}
else if (role == BaseModel::XmlRole)
{
@@ -61,7 +62,7 @@ QVariant MapWildListModel::data(int role) const
}
else if (role == BaseModel::WidgetRole)
{
- QWidget* widget = new MapWildListUI(qobject_cast<Sigmod::MapWildList*>(m_object), NULL);
+ QWidget* widget = new MapWildListUI(qobject_cast<MapWildList*>(m_object), NULL);
return QVariant::fromValue(widget);
}
else if (role == BaseModel::ContextMenuRole)
@@ -94,7 +95,7 @@ bool MapWildListModel::setData(const QVariant& value, int role)
}
else if (xml.doctype().name() == "MapWildListEncounter")
{
- addObject(qobject_cast<Sigmod::MapWildList*>(m_object)->newEncounter(xml.documentElement()));
+ addObject(qobject_cast<MapWildList*>(m_object)->newEncounter(xml.documentElement()));
return true;
}
}
@@ -108,12 +109,12 @@ QString MapWildListModel::types() const
return type().append(QString(";MapWildListEncounter"));
}
-void MapWildListModel::addObject(Sigmod::Object* object)
+void MapWildListModel::addObject(Object* object)
{
if (!object)
- object = qobject_cast<Sigmod::MapWildList*>(m_object)->newEncounter();
+ object = qobject_cast<MapWildList*>(m_object)->newEncounter();
if (object->className() == "MapWildListEncounter")
- addChild(new MapWildListEncounterModel(this, qobject_cast<Sigmod::MapWildListEncounter*>(object)));
+ addChild(new MapWildListEncounterModel(this, qobject_cast<MapWildListEncounter*>(object)));
}
void MapWildListModel::deleteObject(BaseModel* model)
@@ -121,7 +122,7 @@ void MapWildListModel::deleteObject(BaseModel* model)
const int index = find(model);
if (0 <= index)
{
- qobject_cast<Sigmod::MapWildList*>(m_object)->deleteEncounter(index);
+ qobject_cast<MapWildList*>(m_object)->deleteEncounter(index);
m_objects[index]->deleteLater();
m_objects.removeAt(index);
childRowChanged(index);
@@ -135,7 +136,7 @@ void MapWildListModel::deleteSelf()
void MapWildListModel::setupData()
{
- Sigmod::MapWildList* wildList = qobject_cast<Sigmod::MapWildList*>(m_object);
+ MapWildList* wildList = qobject_cast<MapWildList*>(m_object);
for (int i = 0; i < wildList->encounterCount(); ++i)
addChild(new MapWildListEncounterModel(this, wildList->encounter(i)));
}