GUI: Use relative paths in analysis
This commit is contained in:
parent
4c6270f9b2
commit
5e34847592
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue