forked from qt-creator/qt-creator
CompilationDbProjectManager: Fix tree scanning
- We checked for the QFuture's canceled status at a time where it would always yield true. - A pointless default value was used for the project root path. Fixes: QTCREATORBUG-26356 Change-Id: I4d17c6ecb7e9e7e71df737d85b42feb37d3ead5d Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -437,17 +437,14 @@ CompilationDatabaseProject::CompilationDatabaseProject(const Utils::FilePath &pr
|
|||||||
|
|
||||||
Utils::FilePath CompilationDatabaseProject::rootPathFromSettings() const
|
Utils::FilePath CompilationDatabaseProject::rootPathFromSettings() const
|
||||||
{
|
{
|
||||||
#ifdef WITH_TESTS
|
Utils::FilePath rootPath;
|
||||||
return Utils::FilePath::fromString(projectDirectory().fileName());
|
#ifndef WITH_TESTS
|
||||||
#else
|
rootPath = Utils::FilePath::fromString(
|
||||||
auto rootPath = Utils::FilePath::fromString(
|
|
||||||
namedSettings(ProjectExplorer::Constants::PROJECT_ROOT_PATH_KEY).toString());
|
namedSettings(ProjectExplorer::Constants::PROJECT_ROOT_PATH_KEY).toString());
|
||||||
|
|
||||||
if (rootPath.isEmpty())
|
|
||||||
rootPath = Utils::FilePath::fromString(projectDirectory().fileName());
|
|
||||||
|
|
||||||
return rootPath;
|
|
||||||
#endif
|
#endif
|
||||||
|
if (rootPath.isEmpty())
|
||||||
|
rootPath = projectDirectory();
|
||||||
|
return rootPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompilationDatabaseProject::configureAsExampleProject(Kit *kit)
|
void CompilationDatabaseProject::configureAsExampleProject(Kit *kit)
|
||||||
|
@@ -138,9 +138,9 @@ void CompilationDbParser::stop()
|
|||||||
|
|
||||||
QList<FileNode *> CompilationDbParser::scannedFiles() const
|
QList<FileNode *> CompilationDbParser::scannedFiles() const
|
||||||
{
|
{
|
||||||
|
const bool canceled = m_treeScanner->future().isCanceled();
|
||||||
const TreeScanner::Result result = m_treeScanner->release();
|
const TreeScanner::Result result = m_treeScanner->release();
|
||||||
return m_treeScanner && !m_treeScanner->future().isCanceled() ? result.allFiles
|
return !canceled ? result.allFiles : QList<FileNode *>();
|
||||||
: QList<FileNode *>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompilationDbParser::parserJobFinished()
|
void CompilationDbParser::parserJobFinished()
|
||||||
|
Reference in New Issue
Block a user