From 64f304684f2a17b34748166f61c277dad1652101 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Sat, 27 Jun 2009 10:41:30 +0300 Subject: [PATCH] GUI: Remove GUI for showing unused functions. Implements ticket #443 (Remove checking of unused functions from GUI) https://sourceforge.net/apps/trac/cppcheck/ticket/443 See also ticket #434 https://sourceforge.net/apps/trac/cppcheck/ticket/434 --- gui/common.h | 1 - gui/mainwindow.cpp | 15 --------------- gui/mainwindow.h | 12 ------------ gui/resultstree.cpp | 4 ---- 4 files changed, 32 deletions(-) diff --git a/gui/common.h b/gui/common.h index 6b66617df..1cbda23fd 100644 --- a/gui/common.h +++ b/gui/common.h @@ -28,7 +28,6 @@ typedef enum SHOW_ALL = 0, SHOW_STYLE, SHOW_SECURITY, - SHOW_UNUSED, SHOW_ERRORS, SHOW_NONE } diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index fda4edd36..0e46f1e8b 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -45,7 +45,6 @@ MainWindow::MainWindow() : mActionShowAll(tr("Show possible false positives"), this), mActionShowSecurity(tr("Show &security errors"), this), mActionShowStyle(tr("Show s&tyle errors"), this), - mActionShowUnused(tr("Show errors on &unused functions"), this), mActionShowErrors(tr("Show &common errors"), this), mActionShowCheckAll(tr("Show all"), this), mActionShowUncheckAll(tr("Hide all"), this), @@ -73,7 +72,6 @@ MainWindow::MainWindow() : connect(&mActionShowAll, SIGNAL(toggled(bool)), this, SLOT(ShowAll(bool))); connect(&mActionShowSecurity, SIGNAL(toggled(bool)), this, SLOT(ShowSecurity(bool))); connect(&mActionShowStyle, SIGNAL(toggled(bool)), this, SLOT(ShowStyle(bool))); - connect(&mActionShowUnused, SIGNAL(toggled(bool)), this, SLOT(ShowUnused(bool))); connect(&mActionShowErrors, SIGNAL(toggled(bool)), this, SLOT(ShowErrors(bool))); connect(&mActionShowCheckAll, SIGNAL(triggered()), this, SLOT(CheckAll())); connect(&mActionShowUncheckAll, SIGNAL(triggered()), this, SLOT(UncheckAll())); @@ -138,7 +136,6 @@ void MainWindow::CreateMenus() menuview->addAction(&mActionShowAll); menuview->addAction(&mActionShowSecurity); menuview->addAction(&mActionShowStyle); - menuview->addAction(&mActionShowUnused); menuview->addAction(&mActionShowErrors); menuview->addSeparator(); menuview->addAction(&mActionShowCheckAll); @@ -150,7 +147,6 @@ void MainWindow::CreateMenus() mActionShowAll.setCheckable(true); mActionShowSecurity.setCheckable(true); mActionShowStyle.setCheckable(true); - mActionShowUnused.setCheckable(true); mActionShowErrors.setCheckable(true); // Program-menu @@ -194,14 +190,12 @@ void MainWindow::LoadSettings() mActionShowAll.setChecked(mSettings.value(tr("Show all"), true).toBool()); mActionShowSecurity.setChecked(mSettings.value(tr("Show security"), true).toBool()); mActionShowStyle.setChecked(mSettings.value(tr("Show style"), true).toBool()); - mActionShowUnused.setChecked(mSettings.value(tr("Show unused"), true).toBool()); mActionShowErrors.setChecked(mSettings.value(tr("Show errors"), true).toBool()); mResults.ShowResults(SHOW_ALL, mActionShowAll.isChecked()); mResults.ShowResults(SHOW_ERRORS, mActionShowErrors.isChecked()); mResults.ShowResults(SHOW_SECURITY, mActionShowSecurity.isChecked()); mResults.ShowResults(SHOW_STYLE, mActionShowStyle.isChecked()); - mResults.ShowResults(SHOW_UNUSED, mActionShowUnused.isChecked()); mApplications.LoadSettings(mSettings); } @@ -214,7 +208,6 @@ void MainWindow::SaveSettings() mSettings.setValue(tr("Show all"), mActionShowAll.isChecked()); mSettings.setValue(tr("Show security"), mActionShowSecurity.isChecked()); mSettings.setValue(tr("Show style"), mActionShowStyle.isChecked()); - mSettings.setValue(tr("Show unused"), mActionShowUnused.isChecked()); mSettings.setValue(tr("Show errors"), mActionShowErrors.isChecked()); mApplications.SaveSettings(mSettings); } @@ -446,11 +439,6 @@ void MainWindow::ShowStyle(bool checked) mResults.ShowResults(SHOW_STYLE, checked); } -void MainWindow::ShowUnused(bool checked) -{ - mResults.ShowResults(SHOW_UNUSED, checked); -} - void MainWindow::ShowErrors(bool checked) { mResults.ShowResults(SHOW_ERRORS, checked); @@ -500,9 +488,6 @@ void MainWindow::ToggleAllChecked(bool checked) mActionShowStyle.setChecked(checked); ShowStyle(checked); - mActionShowUnused.setChecked(checked); - ShowUnused(checked); - mActionShowErrors.setChecked(checked); ShowErrors(checked); } diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 24acebc21..cad0ce921 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -79,12 +79,6 @@ public slots: */ void ShowStyle(bool checked); - /** - * @brief Show errors with type "unused" - * @param checked Should errors be shown (truw) or hidden (false) - */ - void ShowUnused(bool checked); - /** * @brief Show errors with type "error" * @param checked Should errors be shown (truw) or hidden (false) @@ -289,12 +283,6 @@ protected: */ QAction mActionShowStyle; - /** - * @brief Action to show errors with type "unused" - * - */ - QAction mActionShowUnused; - /** * @brief Action to show errors with type "error" * diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 3c28112d5..617d4e0a6 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -613,10 +613,6 @@ QString ResultsTree::ShowTypeToString(ShowTypes type) return "security"; break; - case SHOW_UNUSED: - return "unused"; - break; - case SHOW_ERRORS: return "error"; break;