From aae388d8ee02ce1e0fcbbc553d0f3751621b8700 Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Sun, 12 Jun 2016 11:21:18 +0200 Subject: [PATCH] logic: Check compilation database path before refreshing --- src/lib/Application.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/lib/Application.cpp b/src/lib/Application.cpp index 87f84fbb..20479151 100644 --- a/src/lib/Application.cpp +++ b/src/lib/Application.cpp @@ -19,6 +19,7 @@ #include "LicenseChecker.h" #include "settings/ApplicationSettings.h" #include "settings/ColorScheme.h" +#include "settings/ProjectSettings.h" std::shared_ptr 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 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) {