diff options
Diffstat (limited to 'sigmodr/tree/TreeWidget.cpp')
| -rw-r--r-- | sigmodr/tree/TreeWidget.cpp | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/sigmodr/tree/TreeWidget.cpp b/sigmodr/tree/TreeWidget.cpp index f0855a79..3450604e 100644 --- a/sigmodr/tree/TreeWidget.cpp +++ b/sigmodr/tree/TreeWidget.cpp @@ -118,37 +118,39 @@ TreeWidget::TreeWidget(QWidget* parent) : // } // } // -// bool TreeWidget::isOpen(const KUrl& url) const -// { -// foreach (const UrlDirty& pair, m_games.values()) -// { -// if (url == pair.first) -// return true; -// } -// return false; -// } -// -// KUrl TreeWidget::url(const Game* game) const -// { -// if (m_games.contains(game)) -// return m_games[game].first; -// return KUrl(); -// } -// -// QStringList TreeWidget::urls() const -// { -// QStringList urls; -// foreach (const UrlDirty& pair, m_games.values()) -// urls << pair.first.prettyUrl(); -// return urls; -// } -// -// void TreeWidget::setUrl(const Game* game, const KUrl& url) -// { -// if (m_games.contains(game)) -// m_games[game] = UrlDirty(url, false); -// } -// +bool TreeWidget::isOpen(const KUrl& url) const +{ + if (url.isEmpty()) + return false; + foreach (const UrlDirty& pair, m_games.values()) + { + if (url == pair.first) + return true; + } + return false; +} + +KUrl TreeWidget::url(const Game* game) const +{ + if (m_games.contains(game)) + return m_games[game].first; + return KUrl(); +} + +QStringList TreeWidget::urls() const +{ + QStringList urls; + foreach (const UrlDirty& pair, m_games.values()) + urls << pair.first.prettyUrl(); + return urls; +} + +void TreeWidget::setUrl(const Game* game, const KUrl& url) +{ + if (m_games.contains(game)) + m_games[game].first = url; +} + void TreeWidget::setDirty(const Game* game, const bool dirty) { if (m_games.contains(game)) |
