diff --git a/src/lib/Project.cpp b/src/lib/Project.cpp index 9bbb1159..07f37c51 100644 --- a/src/lib/Project.cpp +++ b/src/lib/Project.cpp @@ -88,6 +88,11 @@ FilePath Project::getProjectSettingsFilePath() const return getProjectSettings()->getFilePath(); } +LanguageType Project::getLanguage() const +{ + return getProjectSettings()->getLanguage(); +} + std::string Project::getDescription() const { return getProjectSettings()->getDescription(); diff --git a/src/lib/Project.h b/src/lib/Project.h index 34f8187a..79404836 100644 --- a/src/lib/Project.h +++ b/src/lib/Project.h @@ -25,6 +25,7 @@ public: void forceRefresh(); FilePath getProjectSettingsFilePath() const; + LanguageType getLanguage() const; std::string getDescription() const; bool settingsEqualExceptNameAndLocation(const ProjectSettings& otherSettings) const; void logStats() const; diff --git a/src/lib/component/controller/GraphController.cpp b/src/lib/component/controller/GraphController.cpp index d173b8de..97b518c6 100644 --- a/src/lib/component/controller/GraphController.cpp +++ b/src/lib/component/controller/GraphController.cpp @@ -13,6 +13,7 @@ #include "data/access/StorageAccess.h" #include "data/parser/AccessKind.h" #include "data/graph/Graph.h" +#include "Application.h" GraphController::GraphController(StorageAccess* storageAccess) : m_storageAccess(storageAccess) @@ -260,7 +261,17 @@ void GraphController::createDummyGraphForTokenIds(const std::vector& tokenId for (std::shared_ptr node : dummyNodes) { node->hasParent = false; - node->name = node->data->getFullName(); + + // we remove the name qualifier for java projects. + // TODO: get rid of this distinction once we implemented better namespace/package display in graph. + if (Application::getInstance()->getCurrentProject()->getLanguage() == LANGUAGE_JAVA && !node->data->isType(Node::NODE_PACKAGE)) + { + node->name = node->data->getName(); + } + else + { + node->name = node->data->getFullName(); + } } m_dummyNodes = dummyNodes;