logic: Refreshing reloads the source code and resets the Token ids to start from 1

This commit is contained in:
Eberhard Graether
2014-07-26 15:31:55 +02:00
parent 68c6ede244
commit 4bf459fa99
7 changed files with 42 additions and 10 deletions
+15 -4
View File
@@ -45,8 +45,7 @@ void Application::loadProject(const std::string& projectSettingsFilePath)
m_project->loadProjectSettings(projectSettingsFilePath);
m_project->parseCode();
MessageActivateToken message(1);
message.dispatch();
MessageActivateToken(1).dispatch();
}
void Application::loadSource(const std::string& sourceDirectoryPath)
@@ -57,8 +56,15 @@ void Application::loadSource(const std::string& sourceDirectoryPath)
m_project->setSourceDirectoryPath(sourceDirectoryPath);
m_project->parseCode();
MessageActivateToken message(1);
message.dispatch();
MessageActivateToken(1).dispatch();
}
void Application::reloadProject()
{
m_project->clearStorage();
m_project->parseCode();
MessageActivateToken(1).dispatch();
}
void Application::handleMessage(MessageLoadProject* message)
@@ -70,3 +76,8 @@ void Application::handleMessage(MessageLoadSource* message)
{
loadSource(message->sourceDirectoryPath);
}
void Application::handleMessage(MessageRefresh* message)
{
reloadProject();
}