From 66bb55e0feab92784209bdcf1b2ce5387a83100e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 21 May 2008 04:55:22 +0000 Subject: [FIX] Opening files and saving now works git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@159 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemodr/PokemodTreeModel.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'pokemodr/PokemodTreeModel.cpp') 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 #include -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()); - 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()); +} -- cgit