GUI: Fixed build directory, use project file path by default

This commit is contained in:
Daniel Marjamäki 2019-07-17 16:01:54 +02:00
parent 64ef879ebf
commit 40600cbc38
1 changed files with 2 additions and 2 deletions

View File

@ -1480,7 +1480,7 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile, const bool check
// file's location directory as root path
if (rootpath.isEmpty() || rootpath == ".")
mCurrentDirectory = inf.canonicalPath();
else if (rootpath.startsWith("."))
else if (rootpath.startsWith("./"))
mCurrentDirectory = inf.canonicalPath() + rootpath.mid(1);
else
mCurrentDirectory = rootpath;
@ -1488,7 +1488,7 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile, const bool check
if (!projectFile->getBuildDir().isEmpty()) {
QString buildDir = projectFile->getBuildDir();
if (!QDir::isAbsolutePath(buildDir))
buildDir = mCurrentDirectory + '/' + buildDir;
buildDir = inf.canonicalPath() + '/' + buildDir;
if (!QDir(buildDir).exists()) {
QMessageBox msg(QMessageBox::Critical,
tr("Cppcheck"),