summaryrefslogtreecommitdiffstats
path: root/pokemodr/PokemodTree.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-05-21 04:55:22 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-05-21 04:55:22 +0000
commit66bb55e0feab92784209bdcf1b2ce5387a83100e (patch)
treea974b25d02581a31b5a4119668585f4ce6a15ba5 /pokemodr/PokemodTree.cpp
parent820bc54980b906042c0b5231147caea2059af7c9 (diff)
downloadsigen-66bb55e0feab92784209bdcf1b2ce5387a83100e.tar.gz
sigen-66bb55e0feab92784209bdcf1b2ce5387a83100e.tar.xz
sigen-66bb55e0feab92784209bdcf1b2ce5387a83100e.zip
[FIX] Opening files and saving now works
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@159 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/PokemodTree.cpp')
-rw-r--r--pokemodr/PokemodTree.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/pokemodr/PokemodTree.cpp b/pokemodr/PokemodTree.cpp
index f94b5216..fee1d26e 100644
--- a/pokemodr/PokemodTree.cpp
+++ b/pokemodr/PokemodTree.cpp
@@ -23,9 +23,7 @@
// PokeModr includes
#include "ObjectUI.h"
-
-// KDE includes
-#include <KUrl>
+#include "PokemodTreeModel.h"
// Qt includes
#include <QHeaderView>
@@ -69,22 +67,32 @@ void PokemodTree::paste(const QModelIndex& index, const QDomDocument& data)
model()->setData(index, data.toString(), BaseModel::XmlRole);
}
-void PokemodTree::addPokemod(Pokemod* pokemod)
+KUrl PokemodTree::url(const Pokemod* pokemod) const
{
- // TODO: add the pokemod to the RootModel
+ if (m_urls.contains(pokemod))
+ return m_urls[pokemod];
+ return KUrl();
}
-void PokemodTree::deletePokemod(const Pokemod* pokemod)
+void PokemodTree::setUrl(Pokemod* pokemod, const KUrl& url)
+{
+ m_urls[pokemod] = url;
+}
+
+void PokemodTree::addPokemod(Pokemod* pokemod)
{
- // TODO: delete the pokemod from the RootModel
+ static_cast<PokemodTreeModel*>(model())->addPokemod(pokemod);
+ m_urls[pokemod] = "";
}
-void PokemodTree::savePokemod(const Pokemod* pokemod)
+void PokemodTree::addPokemod(Pokemod* pokemod, const KUrl& url)
{
- // TODO: save the pokemod
+ static_cast<PokemodTreeModel*>(model())->addPokemod(pokemod);
+ m_urls[pokemod] = url;
}
-void PokemodTree::savePokemod(const Pokemod* pokemod, const KUrl& url)
+void PokemodTree::deletePokemod(const Pokemod* pokemod)
{
- // TODO: save the pokemod
+ static_cast<PokemodTreeModel*>(model())->deletePokemod(pokemod);
+ m_urls.remove(pokemod);
}