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_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"

View File

@ -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()) {

View File

@ -313,14 +313,13 @@
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Clang headers</string>
<string>Visual Studio headers</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<widget class="QLabel" name="mLabelVsIncludePaths">
<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;
&lt;p&gt;Path:&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<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>
</property>
<property name="wordWrap">
<bool>true</bool>
@ -328,22 +327,7 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<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>
<widget class="QLineEdit" name="mEditVsIncludePaths"/>
</item>
</layout>
</widget>

View File

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

View File

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