GUI: Use relative paths in analysis

This commit is contained in:
Daniel Marjamäki 2018-07-01 08:00:05 +02:00
parent 4c6270f9b2
commit 5e34847592
2 changed files with 3 additions and 10 deletions

View File

@ -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;

View File

@ -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);
}