QmakeProjectManager: Fix warning about build/source directory levels

While configuring a project, a wrong warning "Warning: The build
directory should be at the same level as the source directory." was
shown in some cases.

The reason was the innocent assumption that "projectPath" was just the
directory part of the project root. It was in fact the full "file path"
of the .pro file.

Change-Id: Icc5df51423b4bb05098d9d42cd328af949f85005
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Alessandro Portale
2019-04-10 16:34:13 +02:00
parent 177aeaaf35
commit e3586d164b

View File

@@ -591,7 +591,7 @@ QmakeBuildConfigurationFactory::QmakeBuildConfigurationFactory()
issues << version->reportIssues(projectPath, buildDir);
if (QmakeSettings::warnAgainstUnalignedBuildDir()
&& !QmakeBuildConfiguration::isBuildDirAtSafeLocation(
QDir(projectPath).absolutePath(), QDir(buildDir).absolutePath())) {
QFileInfo(projectPath).absoluteDir().path(), QDir(buildDir).absolutePath())) {
issues.append(Task(Task::Warning, QmakeBuildConfiguration::unalignedBuildDirWarning(),
Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));