Skip to content

Commit efff2c5

Browse files
nemaakhileshdanmar
authored andcommitted
Fixed cppcheck-opensource#7294 (GUI: Add option in 'Settings' for 'Statistics Dialog' display.)
1 parent 06ded4a commit efff2c5

5 files changed

Lines changed: 14 additions & 2 deletions

File tree

gui/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
#define SETTINGS_INCONCLUSIVE_ERRORS "Inconclusive errors"
8585
#define SETTINGS_MRU_PROJECTS "MRU Projects"
8686
#define SETTINGS_SHOW_ERROR_ID "Show error Id"
87+
#define SETTINGS_SHOW_STATISTICS "Show statistics"
8788

8889
// The maximum value for the progress bar
8990
#define PROGRESS_MAX 1024.0

gui/mainwindow.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,8 @@ void MainWindow::CheckDone()
763763

764764
// Notify user - if the window is not active - that check is ready
765765
QApplication::alert(this, 3000);
766-
ShowStatistics();
766+
if (mSettings->value(SETTINGS_SHOW_STATISTICS, false).toBool())
767+
ShowStatistics();
767768
}
768769

769770
void MainWindow::CheckLockDownUI()

gui/mainwindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ protected slots:
571571
bool mExiting;
572572

573573
/**
574-
* @brief Set in case of loading project file.
574+
* @brief Set to true in case of loading log file.
575575
*/
576576
bool mIsLogfileLoaded;
577577

gui/settings.ui

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@
150150
</property>
151151
</widget>
152152
</item>
153+
<item>
154+
<widget class="QCheckBox" name="mShowStatistics">
155+
<property name="text">
156+
<string>Show statistics on check completion</string>
157+
</property>
158+
</widget>
159+
</item>
153160
<item>
154161
<spacer name="verticalSpacer_2">
155162
<property name="orientation">
@@ -372,6 +379,7 @@
372379
<tabstop>mSaveFullPath</tabstop>
373380
<tabstop>mListLanguages</tabstop>
374381
<tabstop>mEnableInconclusive</tabstop>
382+
<tabstop>mShowStatistics</tabstop>
375383
<tabstop>mShowDebugWarnings</tabstop>
376384
<tabstop>mButtons</tabstop>
377385
</tabstops>

gui/settingsdialog.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ SettingsDialog::SettingsDialog(ApplicationList *list,
5151
mUI.mSaveFullPath->setCheckState(BoolToCheckState(settings.value(SETTINGS_SAVE_FULL_PATH, false).toBool()));
5252
mUI.mInlineSuppressions->setCheckState(BoolToCheckState(settings.value(SETTINGS_INLINE_SUPPRESSIONS, false).toBool()));
5353
mUI.mEnableInconclusive->setCheckState(BoolToCheckState(settings.value(SETTINGS_INCONCLUSIVE_ERRORS, false).toBool()));
54+
mUI.mShowStatistics->setCheckState(BoolToCheckState(settings.value(SETTINGS_SHOW_STATISTICS, false).toBool()));
5455
mUI.mShowErrorId->setCheckState(BoolToCheckState(settings.value(SETTINGS_SHOW_ERROR_ID, false).toBool()));
5556

5657
connect(mUI.mButtons, SIGNAL(accepted()), this, SLOT(Ok()));
@@ -173,6 +174,7 @@ void SettingsDialog::SaveSettingValues() const
173174
SaveCheckboxValue(&settings, mUI.mShowDebugWarnings, SETTINGS_SHOW_DEBUG_WARNINGS);
174175
SaveCheckboxValue(&settings, mUI.mInlineSuppressions, SETTINGS_INLINE_SUPPRESSIONS);
175176
SaveCheckboxValue(&settings, mUI.mEnableInconclusive, SETTINGS_INCONCLUSIVE_ERRORS);
177+
SaveCheckboxValue(&settings, mUI.mShowStatistics, SETTINGS_SHOW_STATISTICS);
176178
SaveCheckboxValue(&settings, mUI.mShowErrorId, SETTINGS_SHOW_ERROR_ID);
177179

178180
const QListWidgetItem *currentLang = mUI.mListLanguages->currentItem();

0 commit comments

Comments
 (0)