From 5e348475924d6fe035f6a9dac5314a5394a7ca74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 1 Jul 2018 08:00:05 +0200 Subject: [PATCH] GUI: Use relative paths in analysis --- gui/filelist.cpp | 2 +- gui/mainwindow.cpp | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/gui/filelist.cpp b/gui/filelist.cpp index 3031b15ff..2c80ef118 100644 --- a/gui/filelist.cpp +++ b/gui/filelist.cpp @@ -93,7 +93,7 @@ QStringList FileList::getFileList() const if (mExcludedPaths.empty()) { QStringList names; foreach (QFileInfo item, mFileList) { - QString name = QDir::fromNativeSeparators(item.canonicalFilePath()); + QString name = QDir::fromNativeSeparators(item.filePath()); names << name; } return names; diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index c6814a9c5..0b44c7984 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -1480,6 +1480,8 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile, const bool check QFileInfo inf(projectFile->getFilename()); const QString rootpath = projectFile->getRootPath(); + QDir::setCurrent(inf.absolutePath()); + mThread->setAddonsAndTools(projectFile->getAddonsAndTools(), mSettings->value(SETTINGS_MISRA_FILE).toString()); mUI.mResults->setTags(projectFile->getTags()); @@ -1541,15 +1543,6 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile, const bool check if (paths.isEmpty()) { paths << mCurrentDirectory; } - - // Convert relative paths to absolute paths - for (int i = 0; i < paths.size(); i++) { - if (!QDir::isAbsolutePath(paths[i])) { - QString path = mCurrentDirectory + "/"; - path += paths[i]; - paths[i] = QDir::cleanPath(path); - } - } doAnalyzeFiles(paths, checkLibrary, checkConfiguration); }