aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/core/tree_item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/core/tree_item.cpp')
-rw-r--r--engines/titanic/core/tree_item.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index ee89a0532e..22c4e1ddac 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -40,7 +40,7 @@ void CTreeItem::load(SimpleFile *file) {
CMessageTarget::load(file);
}
-CGameManager *CTreeItem::getGameManager() {
+CGameManager *CTreeItem::getGameManager() const {
return _parent ? _parent->getGameManager() : nullptr;
}
@@ -64,17 +64,17 @@ CTreeItem *CTreeItem::getLastSibling() {
return item;
}
-CTreeItem *CTreeItem::getLastChild() {
+CTreeItem *CTreeItem::getLastChild() const {
if (!_firstChild)
return nullptr;
return _firstChild->getLastSibling();
}
-CTreeItem *CTreeItem::scan(CTreeItem *item) {
+CTreeItem *CTreeItem::scan(CTreeItem *item) const {
if (_firstChild)
return _firstChild;
- CTreeItem *treeItem = this;
+ const CTreeItem *treeItem = this;
while (treeItem != item) {
if (treeItem->_nextSibling)
return treeItem->_nextSibling;
@@ -87,19 +87,6 @@ CTreeItem *CTreeItem::scan(CTreeItem *item) {
return nullptr;
}
-CDontSaveFileItem *CTreeItem::getDontSaveFileItem() {
- CTreeItem *item = getFirstChild();
- while (item) {
- CDontSaveFileItem *fileItem = dynamic_cast<CDontSaveFileItem *>(item);
- if (fileItem)
- return fileItem;
-
- item = item->getNextSibling();
- }
-
- return nullptr;
-}
-
void CTreeItem::addUnder(CTreeItem *newParent) {
if (newParent->_firstChild)
addSibling(newParent->getLastSibling());