src: code cleanup

* removed unused code: ParseFunction, ParseVariable and ParseTypeUsage. All this is handled using NameHierarchies now.
* Moved the getErrorCount method from ParserClient to the StorageAccess
* MessageFinishedParsing doesn't know the error count anymore.
* StatusBarController now has a StorageAccess to fetch the error count when needed.
This commit is contained in:
malte_langkabel
2016-03-07 10:59:39 +01:00
parent 5cdaafc6de
commit 6d7a1faaa4
25 changed files with 121 additions and 590 deletions
@@ -1,10 +1,11 @@
#include "component/controller/StatusBarController.h"
#include "component/view/StatusBarView.h"
#include "data/access/StorageAccess.h"
#include "utility/logging/logging.h"
#include "component/view/StatusBarView.h"
StatusBarController::StatusBarController()
StatusBarController::StatusBarController(StorageAccess* storageAccess)
: m_storageAccess(storageAccess)
{
}
@@ -24,7 +25,17 @@ void StatusBarController::handleMessage(MessageClearErrorCount* message)
void StatusBarController::handleMessage(MessageFinishedParsing* message)
{
getView()->setErrorCount(message->errorCount);
ErrorCountInfo errorCount = m_storageAccess->getErrorCount();
getView()->setErrorCount(errorCount);
std::string status = message->getStatusStr();
status += " " + std::to_string(errorCount.total) + " error" + (errorCount.total > 1 ? "s" : "");
if (errorCount.fatal > 0)
{
status += " (" + std::to_string(errorCount.fatal) + " fatal)";
}
MessageStatus(status, errorCount.total > 0).dispatch();
}
void StatusBarController::handleMessage(MessageShowErrors* message)