diff options
Diffstat (limited to 'pokemodr/models/TimeModel.cpp')
-rw-r--r-- | pokemodr/models/TimeModel.cpp | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/pokemodr/models/TimeModel.cpp b/pokemodr/models/TimeModel.cpp index f2e7941c..a1c591e4 100644 --- a/pokemodr/models/TimeModel.cpp +++ b/pokemodr/models/TimeModel.cpp @@ -36,7 +36,6 @@ TimeModel::TimeModel(BaseModel* parent, Object* object) : TimeModel::~TimeModel() { - // TODO: destruct } QVariant TimeModel::data(int role) const @@ -51,11 +50,6 @@ QVariant TimeModel::data(int role) const return QVariant(); } -int TimeModel::rowCount() const -{ - return 0; -} - bool TimeModel::setData(const QVariant& value, int role) { if (role == Qt::UserRole) @@ -74,50 +68,31 @@ bool TimeModel::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* TimeModel::childItem(const int row) -{ - return NULL; -} - int TimeModel::indexNumber() const { return m_object->pokemod()->timeIndex(m_object->id()); } -bool TimeModel::canInsertRows() const -{ - return false; -} - -bool TimeModel::insertRows(const int rows) -{ - return false; -} - -bool TimeModel::canRemoveRows() const -{ - return false; -} - -bool TimeModel::removeRows(const int position, const int rows) -{ - return false; -} - // bool TimeModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column) // { // // TODO: drag/drop |