GUI: VS headers for clang-tidy

This commit is contained in:
Daniel Marjamäki 2017-08-13 17:13:24 +02:00
parent 83ae7ce270
commit 928e053efc
5 changed files with 7 additions and 45 deletions

View File

@ -81,7 +81,7 @@
#define SETTINGS_LANGUAGE "Application language" #define SETTINGS_LANGUAGE "Application language"
#define SETTINGS_GLOBAL_INCLUDE_PATHS "Global include paths" #define SETTINGS_GLOBAL_INCLUDE_PATHS "Global include paths"
#define SETTINGS_CLANG_PATH "Clang path" #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_INLINE_SUPPRESSIONS "Inline suppressions"
#define SETTINGS_INCONCLUSIVE_ERRORS "Inconclusive errors" #define SETTINGS_INCONCLUSIVE_ERRORS "Inconclusive errors"
#define SETTINGS_MRU_PROJECTS "MRU Projects" #define SETTINGS_MRU_PROJECTS "MRU Projects"

View File

@ -444,12 +444,8 @@ void MainWindow::doAnalyzeProject(ImportProject p)
//mThread->SetanalyzeProject(true); //mThread->SetanalyzeProject(true);
if (mProjectFile) { if (mProjectFile) {
mThread->setAddons(mProjectFile->getAddons()); mThread->setAddons(mProjectFile->getAddons());
QString clangHeaders = mSettings->value(SETTINGS_CLANG_HEADERS).toString(); QString clangHeaders = mSettings->value(SETTINGS_VS_INCLUDE_PATHS).toString();
QStringList includePaths; mThread->setClangIncludePaths(clangHeaders.split(";"));
if (!clangHeaders.isEmpty()) {
includePaths << clangHeaders << (clangHeaders+"/ATLMFC") << (clangHeaders+"/c++") << (clangHeaders+"/c++/i686-w64-mingw32");
}
mThread->setClangIncludePaths(includePaths);
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
QString clangPath = mSettings->value(SETTINGS_CLANG_PATH,QString()).toString(); QString clangPath = mSettings->value(SETTINGS_CLANG_PATH,QString()).toString();
if (clangPath.isEmpty()) { if (clangPath.isEmpty()) {

View File

@ -313,14 +313,13 @@
<item> <item>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="groupBox_2">
<property name="title"> <property name="title">
<string>Clang headers</string> <string>Visual Studio headers</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_9"> <layout class="QVBoxLayout" name="verticalLayout_9">
<item> <item>
<widget class="QLabel" name="mLabelVsIncludePaths"> <widget class="QLabel" name="mLabelVsIncludePaths">
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Download the &quot;clang headers&quot; archive and unpack it. You can get it here: &lt;a href=&quot;http://sourceforge.net/projects/cppcheck/files/other/&quot;&gt;http://sourceforge.net/projects/cppcheck/files/other&lt;/a&gt;&lt;/p&gt; <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Paths to Visual Studio headers, separated by semicolon ';'.&lt;/p&gt;&lt;p&gt;You can open a Visual Studio command prompt, write &amp;quot;SET INCLUDE&amp;quot;. Then copy/paste the paths.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;p&gt;Path:&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
@ -328,22 +327,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <widget class="QLineEdit" name="mEditVsIncludePaths"/>
<item>
<widget class="QLineEdit" name="mEditClangHeaders">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mButtonBrowseClangHeaders">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>

View File

@ -57,9 +57,8 @@ SettingsDialog::SettingsDialog(ApplicationList *list,
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
//mUI.mTabClang->setVisible(true); //mUI.mTabClang->setVisible(true);
mUI.mEditClangPath->setText(settings.value(SETTINGS_CLANG_PATH, QString()).toString()); 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.mBtnBrowseClangPath, &QPushButton::released, this, &SettingsDialog::browseClangPath);
connect(mUI.mButtonBrowseClangHeaders, &QPushButton::released, this, &SettingsDialog::browseClangHeaders);
#else #else
mUI.mTabClang->setVisible(false); mUI.mTabClang->setVisible(false);
#endif #endif
@ -306,16 +305,3 @@ void SettingsDialog::browseClangPath()
mUI.mEditClangPath->setText(selectedDir); 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);
}
}

View File

@ -126,10 +126,6 @@ protected slots:
/** @brief Slot for browsing for the clang binary */ /** @brief Slot for browsing for the clang binary */
void browseClangPath(); void browseClangPath();
/** @brief Slot for browsing for the clang headers */
void browseClangHeaders();
protected: protected:
/** /**
* @brief Clear all applications from the list and re insert them from mTempApplications * @brief Clear all applications from the list and re insert them from mTempApplications