ui/data: cleaned up UI and parsing

* HOT FIX: typename not always correctly split to name hierarchy
* show node main if available as first active token after parsing
* show all contents of namespaces if searched for
* added missing enum type and enum value usages
* added inheritance for structs
* removed MessageActivateToken and replaced it with MessageActivateTokens
* activating correct nodes for clicks in GraphView and CodeView
* no graph change when clicking an edge, but highlighting the edge instead
* only show active nodes without connections when multiple are activated
* fixed snippet sorting to put file that contains declarations on top
* set sizeHints on CodeView and SearchView to increase their initial size

fortune cookie message = Das Leben wird eine positive Wendung nehmen.
This commit is contained in:
Eberhard Graether
2015-01-08 12:12:50 +01:00
parent ee85abfc7b
commit 8242454104
41 changed files with 703 additions and 294 deletions
+26 -1
View File
@@ -352,7 +352,7 @@ public:
TS_ASSERT(isValidLocation(locations[0], 1));
}
void test_storage_saves_inheritance()
void test_storage_saves_class_inheritance()
{
TestStorage storage;
storage.onClassParsed(validLocation(), utility::splitToVector("ClassA", "::"), ParserClient::ACCESS_NONE, validLocation());
@@ -377,6 +377,31 @@ public:
TS_ASSERT(isValidLocation(locations[0], 5));
}
void test_storage_saves_struct_inheritance()
{
TestStorage storage;
storage.onStructParsed(validLocation(), utility::splitToVector("StructA", "::"), ParserClient::ACCESS_NONE, validLocation());
storage.onStructParsed(validLocation(), utility::splitToVector("StructB", "::"), ParserClient::ACCESS_NONE, validLocation());
Id id =
storage.onInheritanceParsed(validLocation(5), utility::splitToVector("StructB", "::"),
utility::splitToVector("StructA", "::"), ParserClient::ACCESS_PUBLIC
);
Edge* edge = storage.getEdgeWithId(id);
TS_ASSERT(edge);
TS_ASSERT_EQUALS(edge->getType(), Edge::EDGE_INHERITANCE);
TS_ASSERT(edge->getComponent<TokenComponentAccess>());
TS_ASSERT_EQUALS(edge->getComponent<TokenComponentAccess>()->getAccess(), TokenComponentAccess::ACCESS_PUBLIC);
TS_ASSERT_EQUALS(edge->getFrom()->getFullName(), "StructB");
TS_ASSERT_EQUALS(edge->getTo()->getFullName(), "StructA");
std::vector<TokenLocation*> locations = storage.getLocationsForId(id);
TS_ASSERT_EQUALS(locations.size(), 1);
TS_ASSERT(isValidLocation(locations[0], 5));
}
void test_storage_saves_call()
{
TestStorage storage;