summaryrefslogtreecommitdiffstats
path: root/pokemodr/models/WeatherGroupModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemodr/models/WeatherGroupModel.cpp')
-rw-r--r--pokemodr/models/WeatherGroupModel.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/pokemodr/models/WeatherGroupModel.cpp b/pokemodr/models/WeatherGroupModel.cpp
index 4faf3bf2..26f1c34e 100644
--- a/pokemodr/models/WeatherGroupModel.cpp
+++ b/pokemodr/models/WeatherGroupModel.cpp
@@ -31,31 +31,31 @@
// KDE includes
#include <KMenu>
-WeatherGroupModel::WeatherGroupModel(BaseModel* parent, Pokemod* pokemod) :
+Pokemodr::WeatherGroupModel::WeatherGroupModel(BaseModel* parent, Pokemod::Pokemod* pokemod) :
GroupModel(parent, pokemod, "Weathers")
{
for (int i = 0; i < pokemod->weatherCount(); ++i)
addObject(pokemod->weather(i));
}
-WeatherGroupModel::~WeatherGroupModel()
+Pokemodr::WeatherGroupModel::~WeatherGroupModel()
{
}
-QVariant WeatherGroupModel::data(const int role) const
+QVariant Pokemodr::WeatherGroupModel::data(const int role) const
{
- if (role == BaseModel::ContextMenuRole)
+ if (role == Pokemodr::BaseModel::ContextMenuRole)
{
KMenu* menu = new KMenu;
menu->addAction("Add Weather", this, SLOT(addObject()));
return QVariant::fromValue(static_cast<void*>(menu));
}
- return GroupModel::data(role);
+ return Pokemodr::GroupModel::data(role);
}
-bool WeatherGroupModel::setData(const QVariant& value, int role)
+bool Pokemodr::WeatherGroupModel::setData(const QVariant& value, int role)
{
- if (role == BaseModel::XmlRole)
+ if (role == Pokemodr::BaseModel::XmlRole)
{
if (value.canConvert<QString>())
{
@@ -65,7 +65,7 @@ bool WeatherGroupModel::setData(const QVariant& value, int role)
{
if (xml.doctype().name() == "Weather")
{
- addObject(static_cast<Pokemod*>(m_object)->newWeather(xml.documentElement()));
+ addObject(static_cast<Pokemod::Pokemod*>(m_object)->newWeather(xml.documentElement()));
return true;
}
file.close();
@@ -75,20 +75,20 @@ bool WeatherGroupModel::setData(const QVariant& value, int role)
return false;
}
-void WeatherGroupModel::addObject(Object* object)
+void Pokemodr::WeatherGroupModel::addObject(Pokemod::Object* object)
{
if (!object)
- object = static_cast<Pokemod*>(m_object)->newWeather();
+ object = static_cast<Pokemod::Pokemod*>(m_object)->newWeather();
if (object->className() == "Weather")
- m_objects.append(new WeatherModel(this, static_cast<Weather*>(object)));
+ m_objects.append(new WeatherModel(this, static_cast<Pokemod::Weather*>(object)));
}
-void WeatherGroupModel::deleteObject(BaseObjectModel* model)
+void Pokemodr::WeatherGroupModel::deleteObject(BaseObjectModel* model)
{
const int index = m_objects.indexOf(model);
if (0 <= index)
{
- static_cast<Pokemod*>(m_object)->deleteWeather(index);
+ static_cast<Pokemod::Pokemod*>(m_object)->deleteWeather(index);
m_objects[index]->deleteLater();
m_objects.removeAt(index);
}