From e3fb05739714da5858f675c1276eebe53c32a108 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 15 May 2018 08:58:01 +0200 Subject: [PATCH] Valgrind: Add clear button to callgrind tool Callgrind runs can spread TextMarks across files. Only way to get rid of them would be to start a new analyze and stop it before it can add new TextMarks. Be user-friendly and allow clearing the data including the TextMarks explicitly. Change-Id: If8d5c5f789414709a110249377ce907466c0fdf1 Reviewed-by: Leena Miettinen Reviewed-by: hjk --- src/plugins/valgrind/callgrindtool.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 294e28e665d..2903b3cae56 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -217,6 +217,7 @@ public: QAction *m_dumpAction = nullptr; QAction *m_resetAction = nullptr; QAction *m_pauseAction = nullptr; + QAction *m_discardAction = nullptr; QString m_toggleCollectFunction; bool m_toolBusy = false; @@ -392,6 +393,15 @@ CallgrindTool::CallgrindTool() action->setToolTip(tr("Pause event logging. No events are counted which will speed up program execution during profiling.")); connect(action, &QAction::toggled, this, &CallgrindTool::pauseToggled); + // discard data action + m_discardAction = action = new QAction(this); + action->setIcon(Utils::Icons::CLEAN_TOOLBAR.icon()); + action->setToolTip(tr("Discard Data")); + connect(action, &QAction::triggered, this, [this](bool) { + clearTextMarks(); + doClear(true); + }); + // navigation // go back m_goBack = action = new QAction(this); @@ -421,6 +431,7 @@ CallgrindTool::CallgrindTool() toolbar.addAction(m_dumpAction); toolbar.addAction(m_resetAction); toolbar.addAction(m_pauseAction); + toolbar.addAction(m_discardAction); toolbar.addAction(m_goBack); toolbar.addAction(m_goNext); toolbar.addWidget(new Utils::StyledSeparator);