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
|
||||
{
|
||||
#ifdef WITH_TESTS
|
||||
return Utils::FilePath::fromString(projectDirectory().fileName());
|
||||
#else
|
||||
auto rootPath = Utils::FilePath::fromString(
|
||||
Utils::FilePath rootPath;
|
||||
#ifndef WITH_TESTS
|
||||
rootPath = Utils::FilePath::fromString(
|
||||
namedSettings(ProjectExplorer::Constants::PROJECT_ROOT_PATH_KEY).toString());
|
||||
|
||||
if (rootPath.isEmpty())
|
||||
rootPath = Utils::FilePath::fromString(projectDirectory().fileName());
|
||||
|
||||
return rootPath;
|
||||
#endif
|
||||
if (rootPath.isEmpty())
|
||||
rootPath = projectDirectory();
|
||||
return rootPath;
|
||||
}
|
||||
|
||||
void CompilationDatabaseProject::configureAsExampleProject(Kit *kit)
|
||||
|
@@ -138,9 +138,9 @@ void CompilationDbParser::stop()
|
||||
|
||||
QList<FileNode *> CompilationDbParser::scannedFiles() const
|
||||
{
|
||||
const bool canceled = m_treeScanner->future().isCanceled();
|
||||
const TreeScanner::Result result = m_treeScanner->release();
|
||||
return m_treeScanner && !m_treeScanner->future().isCanceled() ? result.allFiles
|
||||
: QList<FileNode *>();
|
||||
return !canceled ? result.allFiles : QList<FileNode *>();
|
||||
}
|
||||
|
||||
void CompilationDbParser::parserJobFinished()
|
||||
|
Reference in New Issue
Block a user