diff options
Diffstat (limited to 'pokemodr/PokemodTreeModel.cpp')
| -rw-r--r-- | pokemodr/PokemodTreeModel.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/pokemodr/PokemodTreeModel.cpp b/pokemodr/PokemodTreeModel.cpp index 60bab37d..fb8aa4f5 100644 --- a/pokemodr/PokemodTreeModel.cpp +++ b/pokemodr/PokemodTreeModel.cpp @@ -26,12 +26,10 @@ #include <QMimeData> #include <QStringList> -PokemodTreeModel::PokemodTreeModel(const QStringList& pokemods, QObject* parent) : - QAbstractItemModel(parent) +PokemodTreeModel::PokemodTreeModel(QObject* parent) : + QAbstractItemModel(parent), + m_root(new RootModel) { - emit(layoutAboutToBeChanged()); - m_root = new RootModel(QList<QVariant>()); - emit(layoutChanged()); } PokemodTreeModel::~PokemodTreeModel() @@ -165,3 +163,17 @@ bool PokemodTreeModel::dropMimeData(const QMimeData* data, Qt::DropAction action emit(layoutChanged()); return success; } + +void PokemodTreeModel::addPokemod(Pokemod* pokemod) +{ + emit(layoutAboutToBeChanged()); + m_root->addPokemod(pokemod); + emit(layoutChanged()); +} + +void PokemodTreeModel::deletePokemod(const Pokemod* pokemod) +{ + emit(layoutAboutToBeChanged()); + m_root->deletePokemod(pokemod); + emit(layoutChanged()); +} |
