diff mbox series

[3/5] kernel-shark-qt: Rearrange the KsQuickContextMenu menu

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

Commit Message

Yordan Karadzhov Jan. 10, 2019, 1:44 p.m. UTC
Swaps the position of the Show / Hide actions in the menu. This is
done because we expect the "Show" actions to be used more often.

Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>
---
 kernel-shark-qt/src/KsQuickContextMenu.cpp | 26 ++++++++++++----------
 1 file changed, 14 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/kernel-shark-qt/src/KsQuickContextMenu.cpp b/kernel-shark-qt/src/KsQuickContextMenu.cpp
index 4f922a2..7ab5a5f 100644
--- a/kernel-shark-qt/src/KsQuickContextMenu.cpp
+++ b/kernel-shark-qt/src/KsQuickContextMenu.cpp
@@ -88,13 +88,6 @@  KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row,
 
 	addSection("Pointer menu");
 
-	descr = "Hide task [";
-	descr += taskName;
-	descr += "-";
-	descr += QString("%1").arg(pid);
-	descr += "]";
-	lamAddAction(&_hideTaskAction, &KsQuickContextMenu::_hideTask);
-
 	descr = "Show task [";
 	descr += taskName;
 	descr += "-";
@@ -102,23 +95,32 @@  KsQuickContextMenu::KsQuickContextMenu(KsDataStore *data, size_t row,
 	descr += "] only";
 	lamAddAction(&_showTaskAction, &KsQuickContextMenu::_showTask);
 
-	descr = "Hide event [";
-	descr += kshark_get_event_name_easy(_data->rows()[_row]);
+	descr = "Hide task [";
+	descr += taskName;
+	descr += "-";
+	descr += QString("%1").arg(pid);
 	descr += "]";
-	lamAddAction(&_hideEventAction, &KsQuickContextMenu::_hideEvent);
+	lamAddAction(&_hideTaskAction, &KsQuickContextMenu::_hideTask);
 
 	descr = "Show event [";
 	descr += kshark_get_event_name_easy(_data->rows()[_row]);
 	descr += "] only";
 	lamAddAction(&_showEventAction, &KsQuickContextMenu::_showEvent);
 
-	descr = QString("Hide CPU [%1]").arg(_data->rows()[_row]->cpu);
-	lamAddAction(&_hideCPUAction, &KsQuickContextMenu::_hideCPU);
+	descr = "Hide event [";
+	descr += kshark_get_event_name_easy(_data->rows()[_row]);
+	descr += "]";
+	lamAddAction(&_hideEventAction, &KsQuickContextMenu::_hideEvent);
 
 	if (parentName == "KsTraceViewer") {
 		descr = QString("Show CPU [%1] only").arg(cpu);
 		lamAddAction(&_showCPUAction, &KsQuickContextMenu::_showCPU);
+	}
+
+	descr = QString("Hide CPU [%1]").arg(_data->rows()[_row]->cpu);
+	lamAddAction(&_hideCPUAction, &KsQuickContextMenu::_hideCPU);
 
+	if (parentName == "KsTraceViewer") {
 		descr = "Add [";
 		descr += taskName;
 		descr += "-";