Commit Graph
7 Commits
Author SHA1 Message Date
Eberhard Graether 52baca3962 logic: flag FilterUndefinedNodesFromGraph in ApplicationSettings
If set to true the flag filters all undefined nodes from the graph, unless every active node is undefined.
2015-03-17 15:42:20 +01:00
Eberhard Graether 598041f896 data: parsing file dependencies
This change adds the node NODE_FILE to the graph and the edge EDGE_INCLUDE, which determine the dependencies between
files by parsing the include preprocessor directive. File nodes can be searched and displayed in the GraphView as file
dependency graph. The filter "file" allows for selecting all files. The file depency information is used on project
refresh do determine which files need to get reparsed.
2015-03-03 00:33:13 +01:00
Eberhard Graether b8f6b4be4e data: added Node type NODE_ENUM_CONSTANT 2015-02-10 14:28:53 +01:00
Eberhard Graether a9c93a9437 ui: added smart search box
This change switches the search box in the search view from QLineEdit to the derived QtSmartSearchBox implementation,
which is capeable of displaying tokens of the query as selectable button elements in different colors. It allows for all
the usual mouse and keyboard interactions that the QLineEdit offers.

fortune cookie message = Good news from someone dear is coming soon.
2014-10-22 17:28:46 +02:00
Eberhard Graether fec7abbc9b ui: integrated autocompletion and filtering into SearchView
- QtSearchView was split into QtSearchView and QtSearchBox.
- QtSearchBox contains all Qt elements and can use them purely
- QtSearchView forwards calls from the SearchController to QtSearchBox
- Searching is initiated with MessageSearch to the SearchController
- Autocompletion is initiated with MessageSearchAutocomplete to the SearchController
- The search field is able to create filter queries by only giving autocompletions for the last token in the query
- For named tokens the search field adds their token ids to the query in the form of "A,25" for faster lookup

bug id = #21
2014-09-11 14:53:03 +02:00
Eberhard Graether 4fd1f330ed data: added SearchIndex for fuzzy name search and rewrote name handling in the Storage
This change stores each Token name in the separate singleton class Dictionary. The Dictionary gives each saved word an
Id and thereby avoids duplicated names. E.g if the constructor method "Graph::Graph" is stored then the word "Graph"
only appears once in memory.

The class SearchIndex is now responsible for the name hierarchy and is instantiated by the Storage. The SearchIndex
builds the name hierarchy using SearchNodes, each holding a Dictionary string reference of the name it holds. E.g if the
names "math::ceil" and "math::floor" are added to the SearchIndex then 3 nodes get created, the SearchNode "math" will
hold the two childs "ceil" and "floor".

The hierarchical graph creation functionality got split off from Graph into the new subclass StorageGraph. The
StorageGraph creates nodes with a passed SearchNode pointer of the name it represents in the SearchIndex. Thereby the
StorageGraph reuses the hierarchical information in the SearchIndex and can create nodes much quicker by avoiding node
searches and name comparisions.

The name information is now stored in the Nodes via the TokenComponentName class, which is subclassed into
TokenComponentNameReferenced and TokenComponentNameCached. The StorageClass creates nodes with the component
TokenComponentNameReferenced, which holds a pointer to the SearchNode instance holding the name. This allows for
retrieving the full name of the node, without using other Nodes int the Graph, which might not be present. If the Node
is copied then the component changes to a TokenComponentNameCached, which holds the full name as a string, so the
memory in the Storage doesn't have to be accessed anymore.

TokenComponentSignature is now only holding an Id of the signature string saved in the Dictionary, which speeds up the
signature comparison. A follow-up will change saving the whole signature as string to reusing the wordIds it is
consisting of.

Lastly the SearchIndex holds basic fuzzy search functionality. A passed query gets compared down the SearchNode
hierarchy as long as matches for each letter are found. Matches must contain all letters of the query. The search is
case-insensitive. If letters are found in front positions, next to each other or written in uppercase they are weighed
higher in the match ranking. The character ':' is also interpreted and found, although the '::' delimiter is not stored.

E.g. the query "m:l" used on the example above will return both "math::floor" and "math::ceil", but "floor" is ranked
higher because the 'l' appears closer to the start.
2014-09-06 01:13:07 +02:00
Eberhard Graether c84972b96e logic: added query syntax and filtering system for search
This change allows the user to use a simple query syntax in the search field to filter the results using names,
operators and predefined filters.

The class QueryTree is capable of parsing a simple query language consiting of QueryNodes, subclassed as
QueryOperators, QueryCommands and QueryTokens. QueryToken identifies a Token by name. QueryCommand represents predefined
filters. QueryOperator defines the syntactic relationship.

QueryNode examples:
	"A" -> QueryToken that identifies the Token named A
	class -> QueryCommand that filters all Nodes that are classes
	. -> QueryOperator that concatenates filters

QueryExamples:
	"A".class -> All Tokens named A that are classes
	method.(private|protected) -> All methods that are private or protected
	"A".member -> All members of A
	"A":field.!const -> All fields of A that are not const (':' can be used instead of '.member')

QueryTree checks for correct operator precedence and validity of the query.
All QueryCommands can be found in data/query/QueryCommand.cpp
All QueryOperators can be found in data/query/QueryOperator.cpp

The parsed QueryTree is then passed to the class GraphFilterConductor, which is capable of applying the query on a
Graph. Each part of the query gets assigned a GraphFilter that filters the input Graph in order of node precedence. The
class SubGraph is used as intermediate container, only holding bare pointers to Nodes and Edges. The output Graph holds
all Nodes that match the query.

MessageActivateTokens is used to show all of the results in the CodeView. The GraphView currently only shows the first
Node of the results.

bug id = #6
2014-08-30 18:24:00 +02:00