Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
logic: Unblock UI when aborting indexing after partial refresh warning
Browse files Browse the repository at this point in the history
  • Loading branch information
egraether committed Apr 23, 2019
1 parent 9e9d488 commit ee1fd9c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/lib/project/Project.cpp
Expand Up @@ -436,14 +436,15 @@ void Project::buildIndex(RefreshInfo info, std::shared_ptr<DialogView> dialogVie

if (abortIndexing)
{
if (dialogView->confirm(
if (m_hasGUI && dialogView->confirm(
"<p>This project contains a source group of type \"" + sourceGroupTypeToString(sourceGroup->getType()) + "\" "
"that cannot be partially cleared. Do you want to re-index the whole project instead?</p>",
{ "Full Re-Index", "Cancel" }
) == 1)
{
MessageStatus(L"Cannot partially clear project. Indexing aborted.").dispatch();
m_refreshStage = RefreshStageType::NONE;
dialogView->clearDialogs();
return;
}
else
Expand Down Expand Up @@ -499,7 +500,7 @@ void Project::buildIndex(RefreshInfo info, std::shared_ptr<DialogView> dialogVie
{
if (sourceGroup->getStatus() == SOURCE_GROUP_STATUS_ENABLED)
{
if (sourceGroup->getType() == SOURCE_GROUP_CUSTOM_COMMAND ||
if (sourceGroup->getType() == SOURCE_GROUP_CUSTOM_COMMAND ||
sourceGroup->getType() == SOURCE_GROUP_PYTHON_EMPTY)
{
customIndexerCommandProvider->addProvider(sourceGroup->getIndexerCommandProvider(info.filesToIndex));
Expand Down Expand Up @@ -620,8 +621,8 @@ void Project::buildIndex(RefreshInfo info, std::shared_ptr<DialogView> dialogVie

taskSequential->addTask(
std::make_shared<TaskExecuteCustomCommands>(
std::move(customIndexerCommandProvider),
tempStorage,
std::move(customIndexerCommandProvider),
tempStorage,
dialogView,
adjustedIndexerThreadCount,
getProjectSettingsFilePath().getParentDirectory())
Expand Down

0 comments on commit ee1fd9c

Please sign in to comment.