diff mbox series

[4/5] kernel-shark-qt: Add "clear all filters" action to KsQuickContextMenu

Message ID 20190110134419.20247-5-ykaradzhov@vmware.com (mailing list archive)
State Accepted
Commit 6223d42f17361a1a98089059da80a98f04f68d11
Headers show
Series Cosmetic modifications in KsQuickContextMenu | expand

Commit Message

Yordan Karadzhov Jan. 10, 2019, 1:44 p.m. UTC
A quick access to this action can save time and be very useful.

Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark-qt/src/KsQuickContextMenu.cpp | 6 +++++-
 kernel-shark-qt/src/KsQuickContextMenu.hpp | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/kernel-shark-qt/src/KsQuickContextMenu.cpp b/kernel-shark-qt/src/KsQuickContextMenu.cpp
index 7ab5a5f..231ca38 100644
--- a/kernel-shark-qt/src/KsQuickContextMenu.cpp
+++ b/kernel-shark-qt/src/KsQuickContextMenu.cpp
@@ -61,7 +61,8 @@  KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row,
   _addCPUPlotAction(this),
   _addTaskPlotAction(this),
   _removeCPUPlotAction(this),
-  _removeTaskPlotAction(this)
+  _removeTaskPlotAction(this),
+  _clearAllFilters(this)
 {
 	typedef void (KsQuickContextMenu::*mfp)();
 	QString taskName, parentName, descr;
@@ -120,6 +121,9 @@  KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row,
 	descr = QString("Hide CPU [%1]").arg(_data->rows()[_row]->cpu);
 	lamAddAction(&_hideCPUAction, &KsQuickContextMenu::_hideCPU);
 
+	descr = "Clear all filters";
+	lamAddAction(&_clearAllFilters, &KsQuickContextMenu::_clearFilters);
+
 	if (parentName == "KsTraceViewer") {
 		descr = "Add [";
 		descr += taskName;
diff --git a/kernel-shark-qt/src/KsQuickContextMenu.hpp b/kernel-shark-qt/src/KsQuickContextMenu.hpp
index 670d010..df8a65b 100644
--- a/kernel-shark-qt/src/KsQuickContextMenu.hpp
+++ b/kernel-shark-qt/src/KsQuickContextMenu.hpp
@@ -85,6 +85,8 @@  private:
 
 	QVector<int> _getFilterVector(tracecmd_filter_id *filter, int newId);
 
+	void _clearFilters() {_data->clearAllFilters();}
+
 	KsDataStore	*_data;
 
 	size_t		_row;
@@ -104,6 +106,8 @@  private:
 	QAction _removeCPUPlotAction;
 
 	QAction _removeTaskPlotAction;
+
+	QAction _clearAllFilters;
 };
 
 /**