logic: moved javapath validation
* moved creation of java environment factory to build index method. This fixes a bug where project refresh was not working when setting the java path after loading the project.
This commit is contained in:
@@ -32,7 +32,7 @@ CxxProject::CxxProject(
|
||||
{
|
||||
}
|
||||
|
||||
bool CxxProject::allowsRefresh()
|
||||
bool CxxProject::prepareRefresh()
|
||||
{
|
||||
FilePath cdbPath = m_projectSettings->getCompilationDatabasePath();
|
||||
if (!cdbPath.empty() && !cdbPath.exists())
|
||||
|
||||
@@ -23,7 +23,7 @@ private:
|
||||
);
|
||||
CxxProject(const CxxProject&);
|
||||
|
||||
virtual bool allowsRefresh();
|
||||
virtual bool prepareRefresh();
|
||||
|
||||
virtual std::shared_ptr<Task> createIndexerTask(
|
||||
PersistentStorage* storage,
|
||||
|
||||
@@ -25,6 +25,10 @@ JavaProject::JavaProject(
|
||||
)
|
||||
: Project(storageAccessProxy, dialogView)
|
||||
, m_projectSettings(projectSettings)
|
||||
{
|
||||
}
|
||||
|
||||
bool JavaProject::prepareIndexing()
|
||||
{
|
||||
if (!JavaEnvironmentFactory::getInstance() && !isTrial())
|
||||
{
|
||||
@@ -47,7 +51,10 @@ JavaProject::JavaProject(
|
||||
if (!JavaEnvironmentFactory::getInstance() && !isTrial())
|
||||
{
|
||||
Application::getInstance()->handleDialog("Coati was unable to locate Java on this machine.\nPlease make sure to provide the correct path in your preferences.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::shared_ptr<Task> JavaProject::createIndexerTask(
|
||||
|
||||
@@ -23,6 +23,8 @@ private:
|
||||
);
|
||||
JavaProject(const JavaProject&);
|
||||
|
||||
virtual bool prepareIndexing();
|
||||
|
||||
virtual std::shared_ptr<Task> createIndexerTask(
|
||||
PersistentStorage* storage,
|
||||
std::shared_ptr<std::mutex> storageMutex,
|
||||
|
||||
+12
-2
@@ -121,7 +121,7 @@ bool Project::refresh(bool forceRefresh)
|
||||
}
|
||||
}
|
||||
|
||||
if (!allowsRefresh())
|
||||
if (!prepareRefresh())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -245,6 +245,11 @@ void Project::load()
|
||||
|
||||
bool Project::buildIndex(bool forceRefresh)
|
||||
{
|
||||
if (!prepareIndexing())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
m_fileManager.fetchFilePaths(
|
||||
forceRefresh ? std::vector<FileInfo>() : m_storage->getInfoOnAllFiles()
|
||||
);
|
||||
@@ -325,7 +330,12 @@ bool Project::buildIndex(bool forceRefresh)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Project::allowsRefresh()
|
||||
bool Project::prepareIndexing()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Project::prepareRefresh()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
-1
@@ -58,7 +58,8 @@ private:
|
||||
void load();
|
||||
bool buildIndex(bool forceRefresh);
|
||||
|
||||
virtual bool allowsRefresh();
|
||||
virtual bool prepareIndexing();
|
||||
virtual bool prepareRefresh();
|
||||
virtual std::shared_ptr<Task> createIndexerTask(
|
||||
PersistentStorage* storage,
|
||||
std::shared_ptr<std::mutex> storageMutex,
|
||||
|
||||
Reference in New Issue
Block a user