* show analysed nodes as bundles in graph * ellide node names longer than 50 chars * sort nodes alphabetic in these bundles * show stats of analysis in code * error are displayed as well in overview * added keywords overview and error * project description can be set in .coatiproject file * description can include links to symbols using [symbol] syntax * updated documentation * increased toc nesting in documentation
50 lines
1.3 KiB
C++
50 lines
1.3 KiB
C++
#include "component/controller/SearchController.h"
|
|
|
|
#include "component/view/SearchView.h"
|
|
#include "data/access/StorageAccess.h"
|
|
|
|
SearchController::SearchController(StorageAccess* storageAccess)
|
|
: m_storageAccess(storageAccess)
|
|
{
|
|
}
|
|
|
|
SearchController::~SearchController()
|
|
{
|
|
}
|
|
|
|
void SearchController::handleMessage(MessageActivateAll* message)
|
|
{
|
|
SearchMatch match = SearchMatch::createCommand(SearchMatch::COMMAND_ALL);
|
|
getView()->setMatches(std::vector<SearchMatch>(1, match));
|
|
}
|
|
|
|
void SearchController::handleMessage(MessageActivateTokens* message)
|
|
{
|
|
if (!message->keepContent() && !message->isFromSearch)
|
|
{
|
|
getView()->setMatches(m_storageAccess->getSearchMatchesForTokenIds(message->tokenIds));
|
|
}
|
|
}
|
|
|
|
void SearchController::handleMessage(MessageFind* message)
|
|
{
|
|
getView()->setFocus();
|
|
}
|
|
|
|
void SearchController::handleMessage(MessageSearchAutocomplete* message)
|
|
{
|
|
LOG_INFO("autocomplete string: \"" + message->query + "\"");
|
|
getView()->setAutocompletionList(m_storageAccess->getAutocompletionMatches(message->query));
|
|
}
|
|
|
|
void SearchController::handleMessage(MessageShowErrors* message)
|
|
{
|
|
SearchMatch match = SearchMatch::createCommand(SearchMatch::COMMAND_ERROR);
|
|
getView()->setMatches(std::vector<SearchMatch>(1, match));
|
|
}
|
|
|
|
SearchView* SearchController::getView()
|
|
{
|
|
return Controller::getView<SearchView>();
|
|
}
|