logic: Fixed cli message handling and Mac build

This commit is contained in:
Eberhard Graether
2017-08-10 01:17:26 +02:00
parent 9269468a7b
commit ece2cbfe14
10 changed files with 48 additions and 78 deletions
+18 -8
View File
@@ -231,10 +231,6 @@ void Application::refreshProject(bool force)
m_componentManager->refreshViews();
}
}
else if (!m_hasGUI)
{
MessageQuitApplication().dispatch();
}
}
}
@@ -263,6 +259,10 @@ void Application::handleMessage(MessageFinishedParsing* message)
{
MessageRefresh().refreshUiOnly().dispatch();
}
else
{
MessageQuitApplication().dispatch();
}
}
void Application::handleMessage(MessageLoadProject* message)
@@ -275,17 +275,27 @@ void Application::handleMessage(MessageLoadProject* message)
return;
}
if (!m_project || projectSettingsFilePath != m_project->getProjectSettingsFilePath())
if (m_project && projectSettingsFilePath == m_project->getProjectSettingsFilePath())
{
createAndLoadProject(projectSettingsFilePath);
if (message->forceRefresh && m_hasGUI)
{
m_project->setStateSettingsUpdated();
refreshProject(false);
}
return;
}
createAndLoadProject(projectSettingsFilePath);
if (message->forceRefresh)
{
m_project->setStateSettingsUpdated();
refreshProject(true);
}
else if (!m_hasGUI)
{
refreshProject(false);
}
}
void Application::handleMessage(MessageRefresh* message)
-11
View File
@@ -3,7 +3,6 @@
#include "component/view/DialogView.h"
#include "data/storage/PersistentStorage.h"
#include "utility/messaging/type/MessageFinishedParsing.h"
#include "utility/messaging/type/MessageQuitApplication.h"
#include "utility/messaging/type/MessageStatus.h"
#include "utility/scheduling/Blackboard.h"
#include "utility/utility.h"
@@ -42,11 +41,6 @@ Task::TaskState TaskFinishParsing::doUpdate(std::shared_ptr<Blackboard> blackboa
dialogView->hideUnknownProgressDialog();
MessageFinishedParsing().dispatch();
if (!Application::getInstance()->hasGUI())
{
MessageQuitApplication().dispatch();
}
float time = utility::duration(start);
if (blackboard->exists("clear_time"))
@@ -104,9 +98,4 @@ void TaskFinishParsing::terminate()
MessageStatus("An unknown exception was thrown during indexing.", true, false).dispatch();
MessageFinishedParsing().dispatch();
if (!Application::getInstance()->hasGUI())
{
MessageQuitApplication().dispatch();
}
}
+9 -8
View File
@@ -260,20 +260,16 @@ void Project::load()
m_storage->buildCaches();
m_storageAccessProxy->setSubject(m_storage.get());
MessageFinishedParsing().dispatch();
if (Application::getInstance()->hasGUI())
{
MessageFinishedParsing().dispatch();
}
MessageStatus("Finished Loading", false, false).dispatch();
}
else
{
MessageStatus("Project not loaded", false, false).dispatch();
}
// refresh always on headless
// since just opening a project in headless does not make sense
if (m_state != PROJECT_STATE_LOADED || !Application::getInstance()->hasGUI())
{
MessageRefresh().dispatch();
}
}
bool Project::requestIndex(bool forceRefresh, bool needsFullRefresh)
@@ -396,6 +392,11 @@ bool Project::requestIndex(bool forceRefresh, bool needsFullRefresh)
if (!filesToClean.size() && !filesToIndex.size())
{
if (!Application::getInstance()->hasGUI())
{
MessageFinishedParsing().dispatch();
}
MessageStatus("Nothing to refresh, all files are up-to-date.").dispatch();
return false;
}