From 6c55d27f196ff063e0703ea28de4d2c297586780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 11 Aug 2019 15:53:03 +0200 Subject: [PATCH] Fixed #9240 (GUI: Issue with file names in suppressions (undesired expansion to full path)) --- gui/mainwindow.cpp | 4 ++-- gui/projectfile.cpp | 13 ------------- gui/projectfile.h | 6 ------ 3 files changed, 2 insertions(+), 21 deletions(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index d7a05ebe2..c70d0c522 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -461,7 +461,7 @@ void MainWindow::doAnalyzeProject(ImportProject p, const bool checkLibrary, cons mThread->setAddonsAndTools(mProjectFile->getAddonsAndTools(), mSettings->value(SETTINGS_MISRA_FILE).toString()); QString clangHeaders = mSettings->value(SETTINGS_VS_INCLUDE_PATHS).toString(); mThread->setClangIncludePaths(clangHeaders.split(";")); - mThread->setSuppressions(mProjectFile->getCheckSuppressions()); + mThread->setSuppressions(mProjectFile->getSuppressions()); } mThread->setProject(p); mThread->check(checkSettings); @@ -860,7 +860,7 @@ Settings MainWindow::getCppcheckSettings() tryLoadLibrary(&result.library, filename); } - foreach (const Suppressions::Suppression &suppression, mProjectFile->getCheckSuppressions()) { + foreach (const Suppressions::Suppression &suppression, mProjectFile->getSuppressions()) { result.nomsg.addSuppression(suppression); } diff --git a/gui/projectfile.cpp b/gui/projectfile.cpp index 7ec3dcfee..1666c7132 100644 --- a/gui/projectfile.cpp +++ b/gui/projectfile.cpp @@ -574,19 +574,6 @@ void ProjectFile::readStringList(QStringList &stringlist, QXmlStreamReader &read } while (!allRead); } -QList ProjectFile::getCheckSuppressions() const -{ - QList ret; - const std::string projectFilePath = Path::getPathFromFilename(mFilename.toStdString()); - foreach (Suppressions::Suppression suppression, getSuppressions()) { - if (!suppression.fileName.empty() && suppression.fileName[0]!='*' && !Path::isAbsolute(suppression.fileName)) - suppression.fileName = Path::simplifyPath(projectFilePath) + suppression.fileName; - - ret.append(suppression); - } - return ret; -} - void ProjectFile::setIncludes(const QStringList &includes) { mIncludeDirs = includes; diff --git a/gui/projectfile.h b/gui/projectfile.h index 4fb0b98fb..63f2be3fb 100644 --- a/gui/projectfile.h +++ b/gui/projectfile.h @@ -148,12 +148,6 @@ public: return mSuppressions; } - /** - * @brief Get "check" suppressions. - * @return list of suppressions. - */ - QList getCheckSuppressions() const; - /** * @brief Get list addons. * @return list of addons.