diff options
Diffstat (limited to 'sigmodr/tree/SigmodrTree.cpp')
-rw-r--r-- | sigmodr/tree/SigmodrTree.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sigmodr/tree/SigmodrTree.cpp b/sigmodr/tree/SigmodrTree.cpp index f7e9790e..49924d8b 100644 --- a/sigmodr/tree/SigmodrTree.cpp +++ b/sigmodr/tree/SigmodrTree.cpp @@ -32,13 +32,14 @@ // Qt includes #include <QtGui/QHeaderView> +using namespace Sigmod; using namespace Sigmodr::Tree; SigmodrTree::SigmodrTree(QWidget* parent) : QTreeView(parent) { SigmodrTreeModel* model = new SigmodrTreeModel(this); - connect(model, SIGNAL(dirty(const Sigmod::Game*, bool)), this, SLOT(setDirty(const Sigmod::Game*, bool))); + connect(model, SIGNAL(dirty(const Game*, bool)), this, SLOT(setDirty(const Game*, bool))); header()->hide(); setModel(model); setRootIndex(model->index(-1, 0, QModelIndex())); @@ -64,12 +65,12 @@ KMenu* SigmodrTree::contextMenu(const QModelIndex& index) return model()->data(index, BaseModel::ContextMenuRole).value<KMenu*>(); } -const Sigmod::Game* SigmodrTree::currentGame() const +const Game* SigmodrTree::currentGame() const { QModelIndex index = currentIndex(); if (index.isValid()) { - const Sigmod::Object* object = static_cast<BaseModel*>(index.internalPointer())->object(); + const Object* object = static_cast<BaseModel*>(index.internalPointer())->object(); if (object) return object->game(); } @@ -88,18 +89,18 @@ void SigmodrTree::paste(const QModelIndex& index, const QDomDocument& data) model()->setData(index, data.toString(), BaseModel::XmlRole); } -QList<const Sigmod::Game*> SigmodrTree::openedGames() const +QList<const Game*> SigmodrTree::openedGames() const { return m_games.keys(); } -void SigmodrTree::addGame(Sigmod::Game* game, const KUrl& url) +void SigmodrTree::addGame(Game* game, const KUrl& url) { qobject_cast<SigmodrTreeModel*>(model())->addGame(game); m_games[game] = UrlDirty(url, false); } -void SigmodrTree::deleteGame(const Sigmod::Game* game) +void SigmodrTree::deleteGame(const Game* game) { if (m_games.contains(game)) { @@ -118,7 +119,7 @@ bool SigmodrTree::isOpen(const KUrl& url) const return false; } -KUrl SigmodrTree::url(const Sigmod::Game* game) const +KUrl SigmodrTree::url(const Game* game) const { if (m_games.contains(game)) return m_games[game].first; @@ -133,13 +134,13 @@ QStringList SigmodrTree::urls() const return urls; } -void SigmodrTree::setUrl(const Sigmod::Game* game, const KUrl& url) +void SigmodrTree::setUrl(const Game* game, const KUrl& url) { if (m_games.contains(game)) m_games[game] = UrlDirty(url, false); } -bool SigmodrTree::dirty(const Sigmod::Game* game) const +bool SigmodrTree::dirty(const Game* game) const { if (m_games.contains(game)) return m_games[game].second; @@ -151,7 +152,7 @@ bool SigmodrTree::dirty() const return dirty(currentGame()); } -void SigmodrTree::setDirty(const Sigmod::Game* game, const bool dirty) +void SigmodrTree::setDirty(const Game* game, const bool dirty) { if (m_games.contains(game)) m_games[game].second = dirty; |