From 928e053efc18c1db6eb85e575cab7748adc25bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 13 Aug 2017 17:13:24 +0200 Subject: [PATCH] GUI: VS headers for clang-tidy --- gui/common.h | 2 +- gui/mainwindow.cpp | 8 ++------ gui/settings.ui | 22 +++------------------- gui/settingsdialog.cpp | 16 +--------------- gui/settingsdialog.h | 4 ---- 5 files changed, 7 insertions(+), 45 deletions(-) diff --git a/gui/common.h b/gui/common.h index 8fb49fb89..2be2496e1 100644 --- a/gui/common.h +++ b/gui/common.h @@ -81,7 +81,7 @@ #define SETTINGS_LANGUAGE "Application language" #define SETTINGS_GLOBAL_INCLUDE_PATHS "Global include paths" #define SETTINGS_CLANG_PATH "Clang path" -#define SETTINGS_CLANG_HEADERS "Clang headers" +#define SETTINGS_VS_INCLUDE_PATHS "VS include paths" #define SETTINGS_INLINE_SUPPRESSIONS "Inline suppressions" #define SETTINGS_INCONCLUSIVE_ERRORS "Inconclusive errors" #define SETTINGS_MRU_PROJECTS "MRU Projects" diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 6e5902a45..1b9397c16 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -444,12 +444,8 @@ void MainWindow::doAnalyzeProject(ImportProject p) //mThread->SetanalyzeProject(true); if (mProjectFile) { mThread->setAddons(mProjectFile->getAddons()); - QString clangHeaders = mSettings->value(SETTINGS_CLANG_HEADERS).toString(); - QStringList includePaths; - if (!clangHeaders.isEmpty()) { - includePaths << clangHeaders << (clangHeaders+"/ATLMFC") << (clangHeaders+"/c++") << (clangHeaders+"/c++/i686-w64-mingw32"); - } - mThread->setClangIncludePaths(includePaths); + QString clangHeaders = mSettings->value(SETTINGS_VS_INCLUDE_PATHS).toString(); + mThread->setClangIncludePaths(clangHeaders.split(";")); #ifdef Q_OS_WIN QString clangPath = mSettings->value(SETTINGS_CLANG_PATH,QString()).toString(); if (clangPath.isEmpty()) { diff --git a/gui/settings.ui b/gui/settings.ui index 9c58fd224..a90cafa24 100644 --- a/gui/settings.ui +++ b/gui/settings.ui @@ -313,14 +313,13 @@ - Clang headers + Visual Studio headers - <html><head/><body><p>Download the "clang headers" archive and unpack it. You can get it here: <a href="http://sourceforge.net/projects/cppcheck/files/other/">http://sourceforge.net/projects/cppcheck/files/other</a></p> -<p>Path:</p></body></html> + <html><head/><body><p>Paths to Visual Studio headers, separated by semicolon ';'.</p><p>You can open a Visual Studio command prompt, write &quot;SET INCLUDE&quot;. Then copy/paste the paths.</p></body></html> true @@ -328,22 +327,7 @@ - - - - - true - - - - - - - ... - - - - + diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp index 3b8a85142..c6a99c36d 100644 --- a/gui/settingsdialog.cpp +++ b/gui/settingsdialog.cpp @@ -57,9 +57,8 @@ SettingsDialog::SettingsDialog(ApplicationList *list, #ifdef Q_OS_WIN //mUI.mTabClang->setVisible(true); mUI.mEditClangPath->setText(settings.value(SETTINGS_CLANG_PATH, QString()).toString()); - mUI.mEditClangHeaders->setText(settings.value(SETTINGS_CLANG_HEADERS, QString()).toString()); + mUI.mEditVsIncludePaths->setText(settings.value(SETTINGS_VS_INCLUDE_PATHS, QString()).toString()); connect(mUI.mBtnBrowseClangPath, &QPushButton::released, this, &SettingsDialog::browseClangPath); - connect(mUI.mButtonBrowseClangHeaders, &QPushButton::released, this, &SettingsDialog::browseClangHeaders); #else mUI.mTabClang->setVisible(false); #endif @@ -306,16 +305,3 @@ void SettingsDialog::browseClangPath() mUI.mEditClangPath->setText(selectedDir); } } - -void SettingsDialog::browseClangHeaders() -{ - QString selectedDir = QFileDialog::getExistingDirectory(this, - tr("Select path for clang headers"), - QDir::homePath()); - - if (!selectedDir.isEmpty()) { - mUI.mEditClangHeaders->setText(selectedDir); - } -} - - diff --git a/gui/settingsdialog.h b/gui/settingsdialog.h index ef55273f6..b49ab6c97 100644 --- a/gui/settingsdialog.h +++ b/gui/settingsdialog.h @@ -126,10 +126,6 @@ protected slots: /** @brief Slot for browsing for the clang binary */ void browseClangPath(); - - /** @brief Slot for browsing for the clang headers */ - void browseClangHeaders(); - protected: /** * @brief Clear all applications from the list and re insert them from mTempApplications