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.
This commit is contained in:
Kimmo Varis 2011-04-16 18:42:32 +03:00
parent 05f59a1567
commit 0112b9e150
5 changed files with 41 additions and 1 deletions

View File

@ -82,6 +82,7 @@ ShowTypes;
#define SETTINGS_LANGUAGE "Application language"
#define SETTINGS_GLOBAL_INCLUDE_PATHS "Global include paths"
#define SETTINGS_INLINE_SUPPRESSIONS "Inline suppressions"
#define SETTINGS_INCONCLUSIVE_ERRORS "Inconclusive errors"
/// @}
#endif

View File

@ -20,6 +20,7 @@
ErrorItem::ErrorItem()
: severity(Severity::none)
, inconclusive(false)
{
}

View File

@ -396,6 +396,7 @@ Settings MainWindow::GetCppcheckSettings()
result._xml = false;
result._jobs = mSettings->value(SETTINGS_CHECK_THREADS, 1).toInt();
result._inlineSuppressions = mSettings->value(SETTINGS_INLINE_SUPPRESSIONS, false).toBool();
result.inconclusive = mSettings->value(SETTINGS_INCONCLUSIVE_ERRORS, false).toBool();
if (result._jobs <= 0)
{

View File

@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -328,6 +328,33 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_6">
<attribute name="title">
<string>Advanced</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QCheckBox" name="mEnableInconclusive">
<property name="text">
<string>&amp;Show inconclusive errors</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item>
@ -349,12 +376,20 @@
<tabstop>mShowFullPath</tabstop>
<tabstop>mShowNoErrorsMessage</tabstop>
<tabstop>mShowDebugWarnings</tabstop>
<tabstop>mInlineSuppressions</tabstop>
<tabstop>mListIncludePaths</tabstop>
<tabstop>mBtnAddIncludePath</tabstop>
<tabstop>mBtnEditIncludePath</tabstop>
<tabstop>mBtnRemoveIncludePath</tabstop>
<tabstop>mListWidget</tabstop>
<tabstop>mBtnAddApplication</tabstop>
<tabstop>mBtnEditApplication</tabstop>
<tabstop>mBtnRemoveApplication</tabstop>
<tabstop>mBtnDefaultApplication</tabstop>
<tabstop>mSaveAllErrors</tabstop>
<tabstop>mSaveFullPath</tabstop>
<tabstop>mListLanguages</tabstop>
<tabstop>mEnableInconclusive</tabstop>
<tabstop>mButtons</tabstop>
</tabstops>
<resources/>

View File

@ -54,6 +54,7 @@ SettingsDialog::SettingsDialog(QSettings *programSettings,
mUI.mSaveAllErrors->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SAVE_ALL_ERRORS, false).toBool()));
mUI.mSaveFullPath->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SAVE_FULL_PATH, false).toBool()));
mUI.mInlineSuppressions->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_INLINE_SUPPRESSIONS, false).toBool()));
mUI.mEnableInconclusive->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_INCONCLUSIVE_ERRORS, false).toBool()));
connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(Ok()));
connect(mUI.mButtons, SIGNAL(rejected()), this, SLOT(reject()));
@ -175,6 +176,7 @@ void SettingsDialog::SaveSettingValues()
SaveCheckboxValue(mUI.mShowNoErrorsMessage, SETTINGS_SHOW_NO_ERRORS);
SaveCheckboxValue(mUI.mShowDebugWarnings, SETTINGS_SHOW_DEBUG_WARNINGS);
SaveCheckboxValue(mUI.mInlineSuppressions, SETTINGS_INLINE_SUPPRESSIONS);
SaveCheckboxValue(mUI.mEnableInconclusive, SETTINGS_INCONCLUSIVE_ERRORS);
QListWidgetItem *currentLang = mUI.mListLanguages->currentItem();
const QString langcode = currentLang->data(LangCodeRole).toString();