summaryrefslogtreecommitdiffstats
path: root/pokemodr/models/RulesModel.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-04-25 00:08:22 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-04-25 00:08:22 +0000
commitdd643ee61d9166761c50803cd379c9343099385c (patch)
tree30d935e81896f3680d5d1c232669e180088d3f37 /pokemodr/models/RulesModel.cpp
parent446fcd9248d4cef74e905c485ef767a94a8463ec (diff)
downloadsigen-dd643ee61d9166761c50803cd379c9343099385c.tar.gz
sigen-dd643ee61d9166761c50803cd379c9343099385c.tar.xz
sigen-dd643ee61d9166761c50803cd379c9343099385c.zip
[FIX] Fleshed out a lot more Model classes
[ADD] New intermediate classes for Objects with subclasses and those without git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@107 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/models/RulesModel.cpp')
-rw-r--r--pokemodr/models/RulesModel.cpp37
1 files changed, 6 insertions, 31 deletions
diff --git a/pokemodr/models/RulesModel.cpp b/pokemodr/models/RulesModel.cpp
index 899aaf9d..4d613a1a 100644
--- a/pokemodr/models/RulesModel.cpp
+++ b/pokemodr/models/RulesModel.cpp
@@ -35,7 +35,6 @@ RulesModel::RulesModel(BaseModel* parent, Object* object) :
RulesModel::~RulesModel()
{
- // TODO: destruct
}
QVariant RulesModel::data(int role) const
@@ -50,11 +49,6 @@ QVariant RulesModel::data(int role) const
return QVariant();
}
-int RulesModel::rowCount() const
-{
- return 0;
-}
-
bool RulesModel::setData(const QVariant& value, int role)
{
if (role == Qt::UserRole)
@@ -73,50 +67,31 @@ bool RulesModel::setData(const QVariant& value, int role)
if (xml.setContent(&file))
{
if (xml.doctype().name() == m_object->className())
+ {
m_object->load(xml.documentElement());
+ return true;
+ }
}
file.close();
}
else if (xml.setContent(value.toString()))
{
if (xml.doctype().name() == m_object->className())
+ {
m_object->load(xml.documentElement());
+ return true;
+ }
}
}
}
return false;
}
-BaseModel* RulesModel::childItem(const int /*row*/)
-{
- return NULL;
-}
-
int RulesModel::indexNumber() const
{
return 0;
}
-bool RulesModel::canInsertRows() const
-{
- return false;
-}
-
-bool RulesModel::insertRows(const int /*rows*/)
-{
- return false;
-}
-
-bool RulesModel::canRemoveRows() const
-{
- return false;
-}
-
-bool RulesModel::removeRows(const int /*position*/, const int /*rows*/)
-{
- return false;
-}
-
// bool RulesModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column)
// {
// // TODO: drag/drop