diff --git a/src/lib/Application.cpp b/src/lib/Application.cpp index 7b0cd368..79584d42 100644 --- a/src/lib/Application.cpp +++ b/src/lib/Application.cpp @@ -72,7 +72,9 @@ void Application::loadProject(const FilePath& projectSettingsFilePath) updateRecentProjects(projectSettingsFilePath); - m_mainView->setTitle(projectSettingsFilePath.fileName()); + m_mainView->setTitle( + projectSettingsFilePath.withoutExtension().fileName() + + "[" + projectSettingsFilePath.fileName() + "]" + " - Coati"); m_storageCache->clear(); m_componentManager->refreshViews(); diff --git a/src/lib/data/search/SearchIndex.cpp b/src/lib/data/search/SearchIndex.cpp index 73bba0d2..39b865f2 100644 --- a/src/lib/data/search/SearchIndex.cpp +++ b/src/lib/data/search/SearchIndex.cpp @@ -105,6 +105,10 @@ SearchNode* SearchIndex::getNode(const std::string& fullName) const SearchNode* SearchIndex::getNode(const SearchNode* searchNode) const { + if(searchNode == nullptr) + { + return nullptr; + } std::deque nameIds = searchNode->getNameIdsRecursive(); if (nameIds.size()) @@ -117,6 +121,10 @@ SearchNode* SearchIndex::getNode(const SearchNode* searchNode) const void SearchIndex::removeNode(SearchNode* searchNode) { + if(searchNode == nullptr) + { + return; + } SearchNode* parent = searchNode->getParent(); if (!parent) @@ -130,6 +138,10 @@ void SearchIndex::removeNode(SearchNode* searchNode) bool SearchIndex::removeNodeIfUnreferencedRecursive(SearchNode* searchNode) { + if(searchNode == nullptr) + { + return false; + } if (!searchNode->hasTokenIdsRecursive()) { SearchNode* parent = searchNode->getParent(); @@ -149,6 +161,11 @@ bool SearchIndex::removeNodeIfUnreferencedRecursive(SearchNode* searchNode) void SearchIndex::addTokenId(SearchNode* node, Id tokenId) { + if(node == nullptr) + { + LOG_ERROR("Node points to nullptr: Can't add tokenid"); + return; + } node->addTokenId(tokenId); m_tokenIds.emplace(tokenId, node); }