summaryrefslogtreecommitdiffstats
path: root/sigmodr/tree/TreeWidget.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-05-21 17:34:41 -0400
committerBen Boeckel <MathStuf@gmail.com>2009-05-21 17:34:41 -0400
commitba4f9b599069b93d2c73e13b43493da5bfe9b40e (patch)
tree33ae8f45b810d751e292a8a303dd878b0a15d7a5 /sigmodr/tree/TreeWidget.cpp
parent1c40145b3bfc2c1310bb126b5d876168dc3919cd (diff)
downloadsigen-ba4f9b599069b93d2c73e13b43493da5bfe9b40e.tar.gz
sigen-ba4f9b599069b93d2c73e13b43493da5bfe9b40e.tar.xz
sigen-ba4f9b599069b93d2c73e13b43493da5bfe9b40e.zip
Add method for getting the game for an index instead of only the current index
Diffstat (limited to 'sigmodr/tree/TreeWidget.cpp')
-rw-r--r--sigmodr/tree/TreeWidget.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/sigmodr/tree/TreeWidget.cpp b/sigmodr/tree/TreeWidget.cpp
index fb7102dc..f1b46e5c 100644
--- a/sigmodr/tree/TreeWidget.cpp
+++ b/sigmodr/tree/TreeWidget.cpp
@@ -65,11 +65,6 @@ ObjectUI* TreeWidget::editorWidget(const QModelIndex& index)
return widget;
}
-const Game* TreeWidget::currentGame() const
-{
- return qobject_cast<TreeModel*>(model())->findGame(currentIndex());
-}
-
// QDomDocument TreeWidget::copy(const QModelIndex& index)
// {
// QDomDocument xml;
@@ -82,6 +77,11 @@ const Game* TreeWidget::currentGame() const
// model()->setData(index, data.toString(), BaseModel::XmlRole);
// }
//
+const Game* TreeWidget::game(const QModelIndex& index) const
+{
+ return qobject_cast<TreeModel*>(model())->findGame(index);
+}
+
QList<const Game*> TreeWidget::openedGames() const
{
return m_games.keys();