Files
Sourcetrail/src/lib/component/controller/ErrorController.cpp
T
Eberhard Graether 6ba93ca39f src: more bug fixes
* fixed snippets added twice on token reactivation for errors and fulltext search results
* fixed colorscheme gets refreshed when cancelling preferences
* scroll to first line in errors table after indexing and showing view
* fixed file not properly expanded when snippet covers full file
* fixed project type naming in project setup
* fixed set delimiter of NameHierarchy for projects that can't be loaded yet
* changed language order for project setup
2017-04-07 17:14:34 +02:00

59 lines
1.0 KiB
C++

#include "component/controller/ErrorController.h"
#include "data/access/StorageAccess.h"
ErrorController::ErrorController(StorageAccess* storageAccess)
: m_storageAccess(storageAccess)
{
}
ErrorController::~ErrorController()
{
}
void ErrorController::handleMessage(MessageClearErrorCount* message)
{
clear();
}
void ErrorController::handleMessage(MessageFinishedParsing* message)
{
clear();
getView()->addErrors(m_storageAccess->getErrors(), false);
}
void ErrorController::handleMessage(MessageNewErrors* message)
{
getView()->addErrors(message->errors, true);
getView()->showDockWidget();
}
void ErrorController::handleMessage(MessageShowErrors* message)
{
if (message->errorId)
{
getView()->setErrorId(message->errorId);
return;
}
clear();
std::vector<ErrorInfo> errors = m_storageAccess->getErrors();
if (errors.size())
{
getView()->showDockWidget();
}
getView()->addErrors(errors, false);
}
ErrorView* ErrorController::getView() const
{
return Controller::getView<ErrorView>();
}
void ErrorController::clear()
{
getView()->clear();
}