logic: improve usability of shallow indexing ui (#823)

* added "--shallow" command line option to request shallow indexing
* modified behavior of Sourcetrail to always perform a deep index if not explicitly specified differently by the user
This commit is contained in:
Malte Langkabel
2019-12-03 18:26:02 +01:00
committed by GitHub
parent 00bf7ebda6
commit fa6dd6c9e1
10 changed files with 52 additions and 39 deletions
+5 -4
View File
@@ -272,7 +272,7 @@ void Project::load(std::shared_ptr<DialogView> dialogView)
}
}
void Project::refresh(RefreshMode refreshMode, std::shared_ptr<DialogView> dialogView)
void Project::refresh(std::shared_ptr<DialogView> dialogView, RefreshMode refreshMode, bool shallowIndexingRequested)
{
if (m_refreshStage != RefreshStageType::NONE)
{
@@ -399,8 +399,7 @@ void Project::refresh(RefreshMode refreshMode, std::shared_ptr<DialogView> dialo
}
}
const bool useShallowIndexing = allowsShallowIndexing &&
(!isLoaded() || m_state == PROJECT_STATE_EMPTY);
const bool useShallowIndexing = allowsShallowIndexing && shallowIndexingRequested;
if (m_hasGUI)
{
@@ -422,7 +421,9 @@ void Project::refresh(RefreshMode refreshMode, std::shared_ptr<DialogView> dialo
}
else
{
buildIndex(getRefreshInfo(refreshMode), dialogView);
RefreshInfo info = getRefreshInfo(refreshMode);
info.shallow = useShallowIndexing;
buildIndex(info, dialogView);
}
}