diff mbox series

[2/5] kernel-shark: Define a method in View for selecting the Passive marker

Message ID 20190212170402.10104-3-ykaradzhov@vmware.com (mailing list archive)
State Accepted
Commit d87eb2e4da6d7530bf395ea714baf89e00d2d63a
Headers show
Series The right click of the button deselects the marker | expand

Commit Message

Yordan Karadzhov Feb. 12, 2019, 5:03 p.m. UTC
The same method can be used to deselect the Passive marker.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202327
Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark/src/KsTraceViewer.cpp | 16 ++++++++++++++++
 kernel-shark/src/KsTraceViewer.hpp |  2 ++
 2 files changed, 18 insertions(+)
diff mbox series

Patch

diff --git a/kernel-shark/src/KsTraceViewer.cpp b/kernel-shark/src/KsTraceViewer.cpp
index 369c78e..61d7386 100644
--- a/kernel-shark/src/KsTraceViewer.cpp
+++ b/kernel-shark/src/KsTraceViewer.cpp
@@ -704,6 +704,22 @@  void KsTraceViewer::_searchItemsMapReduce(int column,
 		lamSearchReduce(_matchList, m.get());
 }
 
+/**
+ * @brief Color (select) the given row in the table, by using the color of the
+ * 	  Passive marker.
+ *
+ * @param row: The row index. If the Passive marker is selected and the input
+ *	        value is negative, the Passive marker will be deselected.
+ */
+void KsTraceViewer::passiveMarkerSelectRow(int row)
+{
+	DualMarkerState state = _mState->getState();
+
+	_view.setVisible(false);
+	_model.selectRow(!state, row);
+	_view.setVisible(true);
+}
+
 /**
  * Get the currently selected row. If no row is selected the function
  * returns -1.
diff --git a/kernel-shark/src/KsTraceViewer.hpp b/kernel-shark/src/KsTraceViewer.hpp
index f59f5df..cf529ba 100644
--- a/kernel-shark/src/KsTraceViewer.hpp
+++ b/kernel-shark/src/KsTraceViewer.hpp
@@ -68,6 +68,8 @@  public:
 
 	void clearSelection();
 
+	void passiveMarkerSelectRow(int row);
+
 	int selectedRow();
 
 	void update(KsDataStore *data);