diff options
Diffstat (limited to 'sigmodr/tree/SigmodrTree.cpp')
-rw-r--r-- | sigmodr/tree/SigmodrTree.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/sigmodr/tree/SigmodrTree.cpp b/sigmodr/tree/SigmodrTree.cpp index 23e9b0d5..63cc5a4c 100644 --- a/sigmodr/tree/SigmodrTree.cpp +++ b/sigmodr/tree/SigmodrTree.cpp @@ -20,14 +20,14 @@ // Sigmodr tree includes #include "BaseModel.h" +#include "SigmodrTreeModel.h" -// Sigmodr widgetincludes +// Sigmodr widget includes #include <sigmodr/widgets/ObjectUI.h> -#include "SigmodrTreeModel.h" // Sigmod includes +#include <sigmod/Game.h> #include <sigmod/Object.h> -#include <sigmod/Sigmod.h> // Qt includes #include <QtGui/QHeaderView> @@ -36,7 +36,7 @@ Sigmodr::Tree::SigmodrTree::SigmodrTree(QWidget* parent) : QTreeView(parent) { SigmodrTreeModel* model = new SigmodrTreeModel(this); - connect(model, SIGNAL(dirty(const Sigmod::Sigmod*, bool)), this, SLOT(setDirty(const Sigmod::Sigmod*, bool))); + connect(model, SIGNAL(dirty(const Sigmod::Game*, bool)), this, SLOT(setDirty(const Sigmod::Game*, bool))); header()->hide(); setModel(model); setRootIndex(model->index(-1, 0, QModelIndex())); @@ -62,14 +62,14 @@ KMenu* Sigmodr::Tree::SigmodrTree::contextMenu(const QModelIndex& index) return model()->data(index, BaseModel::ContextMenuRole).value<KMenu*>(); } -const Sigmod::Sigmod* Sigmodr::Tree::SigmodrTree::currentSigmod() const +const Sigmod::Game* Sigmodr::Tree::SigmodrTree::currentGame() const { QModelIndex index = currentIndex(); if (index.isValid()) { const Sigmod::Object* object = static_cast<BaseModel*>(index.internalPointer())->object(); if (object) - return object->sigmod(); + return object->game(); } return NULL; } @@ -86,29 +86,29 @@ void Sigmodr::Tree::SigmodrTree::paste(const QModelIndex& index, const QDomDocum model()->setData(index, data.toString(), BaseModel::XmlRole); } -QList<const Sigmod::Sigmod*> Sigmodr::Tree::SigmodrTree::openedSigmods() const +QList<const Sigmod::Game*> Sigmodr::Tree::SigmodrTree::openedGames() const { - return m_sigmods.keys(); + return m_games.keys(); } -void Sigmodr::Tree::SigmodrTree::addSigmod(Sigmod::Sigmod* sigmod, const KUrl& url) +void Sigmodr::Tree::SigmodrTree::addSigmod(Sigmod::Game* game, const KUrl& url) { - qobject_cast<SigmodrTreeModel*>(model())->addSigmod(sigmod); - m_sigmods[sigmod] = UrlDirty(url, false); + qobject_cast<SigmodrTreeModel*>(model())->addGame(game); + m_games[game] = UrlDirty(url, false); } -void Sigmodr::Tree::SigmodrTree::deleteSigmod(const Sigmod::Sigmod* sigmod) +void Sigmodr::Tree::SigmodrTree::deleteSigmod(const Sigmod::Game* game) { - if (m_sigmods.contains(sigmod)) + if (m_games.contains(game)) { - qobject_cast<SigmodrTreeModel*>(model())->deleteSigmod(sigmod); - m_sigmods.remove(sigmod); + qobject_cast<SigmodrTreeModel*>(model())->deleteGame(game); + m_games.remove(game); } } bool Sigmodr::Tree::SigmodrTree::isOpen(const KUrl& url) const { - foreach (const UrlDirty& pair, m_sigmods.values()) + foreach (const UrlDirty& pair, m_games.values()) { if (url == pair.first) return true; @@ -116,31 +116,31 @@ bool Sigmodr::Tree::SigmodrTree::isOpen(const KUrl& url) const return false; } -KUrl Sigmodr::Tree::SigmodrTree::url(const Sigmod::Sigmod* sigmod) const +KUrl Sigmodr::Tree::SigmodrTree::url(const Sigmod::Game* game) const { - if (m_sigmods.contains(sigmod)) - return m_sigmods[sigmod].first; + if (m_games.contains(game)) + return m_games[game].first; return KUrl(); } QStringList Sigmodr::Tree::SigmodrTree::urls() const { QStringList urls; - foreach (const UrlDirty& pair, m_sigmods.values()) + foreach (const UrlDirty& pair, m_games.values()) urls << pair.first.prettyUrl(); return urls; } -void Sigmodr::Tree::SigmodrTree::setUrl(const Sigmod::Sigmod* sigmod, const KUrl& url) +void Sigmodr::Tree::SigmodrTree::setUrl(const Sigmod::Game* game, const KUrl& url) { - if (m_sigmods.contains(sigmod)) - m_sigmods[sigmod] = UrlDirty(url, false); + if (m_games.contains(game)) + m_games[game] = UrlDirty(url, false); } -bool Sigmodr::Tree::SigmodrTree::dirty(const Sigmod::Sigmod* sigmod) const +bool Sigmodr::Tree::SigmodrTree::dirty(const Sigmod::Game* game) const { - if (m_sigmods.contains(sigmod)) - return m_sigmods[sigmod].second; + if (m_games.contains(game)) + return m_games[game].second; return false; } @@ -149,10 +149,10 @@ bool Sigmodr::Tree::SigmodrTree::dirty() const return dirty(currentSigmod()); } -void Sigmodr::Tree::SigmodrTree::setDirty(const Sigmod::Sigmod* sigmod, const bool dirty) +void Sigmodr::Tree::SigmodrTree::setDirty(const Sigmod::Game* game, const bool dirty) { - if (m_sigmods.contains(sigmod)) - m_sigmods[sigmod].second = dirty; + if (m_games.contains(game)) + m_games[game].second = dirty; } void Sigmodr::Tree::SigmodrTree::setDirty() |