From d3672430391585eec2ea19a83a92698be840fd1d Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Sun, 26 Dec 2010 18:29:43 +0200 Subject: [PATCH] GUI: Allow enabling inline suppressions from the GUI. Ticket #2342 (inline suppressions not available from the GUI) --- gui/common.h | 1 + gui/mainwindow.cpp | 1 + gui/settings.ui | 7 +++++++ gui/settingsdialog.cpp | 2 ++ 4 files changed, 11 insertions(+) diff --git a/gui/common.h b/gui/common.h index 9748fccc1..9b97d455e 100644 --- a/gui/common.h +++ b/gui/common.h @@ -70,6 +70,7 @@ ShowTypes; #define SETTINGS_LOG_VIEW_HEIGHT "Log/View height" #define SETTINGS_MAINWND_SPLITTER_STATE "Mainwindow/Vertical splitter state" #define SETTINGS_GLOBAL_INCLUDE_PATHS "Global include paths" +#define SETTINGS_INLINE_SUPPRESSIONS "Inline suppressions" /// @} #endif diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 1ff9ce8f1..9bb60f293 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -395,6 +395,7 @@ Settings MainWindow::GetCppcheckSettings() result._force = mSettings->value(SETTINGS_CHECK_FORCE, 1).toBool(); result._xml = false; result._jobs = mSettings->value(SETTINGS_CHECK_THREADS, 1).toInt(); + result._inlineSuppressions = mSettings->value(SETTINGS_INLINE_SUPPRESSIONS, false).toBool(); if (result._jobs <= 0) { diff --git a/gui/settings.ui b/gui/settings.ui index 7769d4e75..50606701b 100644 --- a/gui/settings.ui +++ b/gui/settings.ui @@ -100,6 +100,13 @@ + + + + Enable inline suppressions + + + diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp index ff62e1f16..23214cfb0 100644 --- a/gui/settingsdialog.cpp +++ b/gui/settingsdialog.cpp @@ -50,6 +50,7 @@ SettingsDialog::SettingsDialog(QSettings *programSettings, mUI.mShowDebugWarnings->setCheckState(BoolToCheckState(programSettings->value(SETTINGS_SHOW_DEBUG_WARNINGS, false).toBool())); 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())); connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(Ok())); connect(mUI.mButtons, SIGNAL(rejected()), this, SLOT(reject())); @@ -123,6 +124,7 @@ void SettingsDialog::SaveSettingValues() SaveCheckboxValue(mUI.mShowFullPath, SETTINGS_SHOW_FULL_PATH); SaveCheckboxValue(mUI.mShowNoErrorsMessage, SETTINGS_SHOW_NO_ERRORS); SaveCheckboxValue(mUI.mShowDebugWarnings, SETTINGS_SHOW_DEBUG_WARNINGS); + SaveCheckboxValue(mUI.mInlineSuppressions, SETTINGS_INLINE_SUPPRESSIONS); mSettings->setValue(SETTINGS_GLOBAL_INCLUDE_PATHS, mUI.mEditIncludePaths->text()); }