GUI: Fixed problem with absolute build dir

This commit is contained in:
Daniel Marjamäki 2017-10-08 15:01:03 +02:00
parent d3c9d06aa4
commit 09cdead6cb
1 changed files with 6 additions and 2 deletions

View File

@ -847,8 +847,12 @@ Settings MainWindow::getCppcheckSettings()
const QString &buildDir = mProjectFile->getBuildDir();
if (!buildDir.isEmpty()) {
QString prjpath = QFileInfo(mProjectFile->getFilename()).absolutePath();
result.buildDir = (prjpath + '/' + buildDir).toStdString();
if (QDir(buildDir).isAbsolute()) {
result.buildDir = buildDir.toStdString();
} else {
QString prjpath = QFileInfo(mProjectFile->getFilename()).absolutePath();
result.buildDir = (prjpath + '/' + buildDir).toStdString();
}
}
}