From 09cdead6cb0400c6202eeb05161f90d9167e4f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 8 Oct 2017 15:01:03 +0200 Subject: [PATCH] GUI: Fixed problem with absolute build dir --- gui/mainwindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 5d7a5f127..eeff96359 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -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(); + } } }