logic: Check compilation database path before refreshing

This commit is contained in:
Eberhard Graether
2016-06-12 11:21:18 +02:00
parent b57171552f
commit aae388d8ee
+18
View File
@@ -19,6 +19,7 @@
#include "LicenseChecker.h"
#include "settings/ApplicationSettings.h"
#include "settings/ColorScheme.h"
#include "settings/ProjectSettings.h"
std::shared_ptr<Application> Application::create(
const Version& version, ViewFactory* viewFactory, NetworkFactory* networkFactory
@@ -165,6 +166,23 @@ void Application::refreshProject()
{
MessageStatus("Refreshing Project").dispatch();
FilePath cdbPath = ProjectSettings::getInstance()->getCompilationDatabasePath();
if (!cdbPath.empty() && !cdbPath.exists())
{
MessageStatus("Can't refresh project").dispatch();
if (m_hasGUI)
{
std::vector<std::string> options;
options.push_back("Ok");
m_mainView->confirm(
"Can't refresh. The compilation database of the project does not exist anymore: " + cdbPath.str(),
options);
}
return;
}
m_storageCache->clear();
if (m_hasGUI)
{