Skip to content

Commit 0112b9e

Browse files
committed
GUI: Add option for enabling inconclusive checks.
Add new "Advanced" page to preferences-dialog and add there a checkbox for enabling inconclusive checks. Now that checkbox is the only control in that new page but there will be more controls later on.
1 parent 05f59a1 commit 0112b9e

5 files changed

Lines changed: 41 additions & 1 deletion

File tree

gui/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ ShowTypes;
8282
#define SETTINGS_LANGUAGE "Application language"
8383
#define SETTINGS_GLOBAL_INCLUDE_PATHS "Global include paths"
8484
#define SETTINGS_INLINE_SUPPRESSIONS "Inline suppressions"
85+
#define SETTINGS_INCONCLUSIVE_ERRORS "Inconclusive errors"
8586

8687
/// @}
8788
#endif

gui/erroritem.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
ErrorItem::ErrorItem()
2222
: severity(Severity::none)
23+
, inconclusive(false)
2324
{
2425
}
2526

gui/mainwindow.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ Settings MainWindow::GetCppcheckSettings()
396396
result._xml = false;
397397
result._jobs = mSettings->value(SETTINGS_CHECK_THREADS, 1).toInt();
398398
result._inlineSuppressions = mSettings->value(SETTINGS_INLINE_SUPPRESSIONS, false).toBool();
399+
result.inconclusive = mSettings->value(SETTINGS_INCONCLUSIVE_ERRORS, false).toBool();
399400

400401
if (result._jobs <= 0)
401402
{

gui/settings.ui

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<item>
1818
<widget class="QTabWidget" name="tabWidget">
1919
<property name="currentIndex">
20-
<number>2</number>
20+
<number>0</number>
2121
</property>
2222
<widget class="QWidget" name="tab">
2323
<attribute name="title">
@@ -328,6 +328,33 @@
328328
</item>
329329
</layout>
330330
</widget>
331+
<widget class="QWidget" name="tab_6">
332+
<attribute name="title">
333+
<string>Advanced</string>
334+
</attribute>
335+
<layout class="QVBoxLayout" name="verticalLayout_8">
336+
<item>
337+
<widget class="QCheckBox" name="mEnableInconclusive">
338+
<property name="text">
339+
<string>&amp;Show inconclusive errors</string>
340+
</property>
341+
</widget>
342+
</item>
343+
<item>
344+
<spacer name="verticalSpacer_5">
345+
<property name="orientation">
346+
<enum>Qt::Vertical</enum>
347+
</property>
348+
<property name="sizeHint" stdset="0">
349+
<size>
350+
<width>20</width>
351+
<height>40</height>
352+
</size>
353+
</property>
354+
</spacer>
355+
</item>
356+
</layout>
357+
</widget>
331358
</widget>
332359
</item>
333360
<item>
@@ -349,12 +376,20 @@
349376
<tabstop>mShowFullPath</tabstop>
350377
<tabstop>mShowNoErrorsMessage</tabstop>
351378
<tabstop>mShowDebugWarnings</tabstop>
379+
<tabstop>mInlineSuppressions</tabstop>
380+
<tabstop>mListIncludePaths</tabstop>
381+
<tabstop>mBtnAddIncludePath</tabstop>
382+
<tabstop>mBtnEditIncludePath</tabstop>
383+
<tabstop>mBtnRemoveIncludePath</tabstop>
352384
<tabstop>mListWidget</tabstop>
353385
<tabstop>mBtnAddApplication</tabstop>
354386
<tabstop>mBtnEditApplication</tabstop>
387+
<tabstop>mBtnRemoveApplication</tabstop>
355388
<tabstop>mBtnDefaultApplication</tabstop>
356389
<tabstop>mSaveAllErrors</tabstop>
357390
<tabstop>mSaveFullPath</tabstop>
391+
<tabstop>mListLanguages</tabstop>
392+
<tabstop>mEnableInconclusive</tabstop>
358393
<tabstop>mButtons</tabstop>
359394
</tabstops>
360395
<resources/>

gui/settingsdialog.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ SettingsDialog::SettingsDialog(QSettings *programSettings,
5454
mUI.mSaveAllErrors->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SAVE_ALL_ERRORS, false).toBool()));
5555
mUI.mSaveFullPath->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SAVE_FULL_PATH, false).toBool()));
5656
mUI.mInlineSuppressions->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_INLINE_SUPPRESSIONS, false).toBool()));
57+
mUI.mEnableInconclusive->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_INCONCLUSIVE_ERRORS, false).toBool()));
5758

5859
connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(Ok()));
5960
connect(mUI.mButtons, SIGNAL(rejected()), this, SLOT(reject()));
@@ -175,6 +176,7 @@ void SettingsDialog::SaveSettingValues()
175176
SaveCheckboxValue(mUI.mShowNoErrorsMessage, SETTINGS_SHOW_NO_ERRORS);
176177
SaveCheckboxValue(mUI.mShowDebugWarnings, SETTINGS_SHOW_DEBUG_WARNINGS);
177178
SaveCheckboxValue(mUI.mInlineSuppressions, SETTINGS_INLINE_SUPPRESSIONS);
179+
SaveCheckboxValue(mUI.mEnableInconclusive, SETTINGS_INCONCLUSIVE_ERRORS);
178180

179181
QListWidgetItem *currentLang = mUI.mListLanguages->currentItem();
180182
const QString langcode = currentLang->data(LangCodeRole).toString();

0 commit comments

Comments
 (0)