Skip to contentSkip to conversation

KernelShark: Add guest's stream ID to the combobox item.

PATCH In review Tzvetomir Stoyanov (VMware) 2 participants 2 messages Sep 2, 2020 – Sep 3, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KernelShark: Add guest's stream ID to the combobox item.

From: Tzvetomir (VMware) Stoyanov <[email protected]>

When a new stream is added to the list of guest streams in the ComboBox plugin, attach the stream ID to the entry as well. Later, when the stream is selected from the list, this ID is used to get information of the stream.

---
 src/plugins/KVMCombo.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/plugins/KVMCombo.cpp +1 -1
index 4ca33d4..bc3c6b0 100644
@@ -269,7 +269,7 @@ void KsComboPlotDialog::update()
 			continue;
 
 		streamName = KsUtils::streamDescription(kshark_ctx->stream[sd]);
-		_guestStreamComboBox.addItem(streamName);
+		_guestStreamComboBox.addItem(streamName, sd);
 		color << colTable[sd];
 		_guestStreamComboBox.setItemData(i, QBrush(color),
 						    Qt::BackgroundRole);
Signature · 1 line
2.26.2
#1 lore raw
Quoted 18 lines · Tzvetomir Stoyanov (VMware)

From: Tzvetomir (VMware) Stoyanov <[email protected]>

When a new stream is added to the list of guest streams in the ComboBox plugin, attach the stream ID to the entry as well. Later, when the stream is selected from the list, this ID is used to get information of the stream.

---
  src/plugins/KVMCombo.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
src/plugins/KVMCombo.cpp +0 -0
index 4ca33d4..bc3c6b0 100644

src/plugins/KVMCombo.cpp void KsComboPlotDialog::update() · line 275

Quoted 8 lines
src/plugins/KVMCombo.cpp +1 -1
@@ -269,7 +269,7 @@ void KsComboPlotDialog::update()
  			continue;
 
  		streamName = KsUtils::streamDescription(kshark_ctx->stream[sd]);
-		_guestStreamComboBox.addItem(streamName);
+		_guestStreamComboBox.addItem(streamName, sd);
  		color << colTable[sd];
  		_guestStreamComboBox.setItemData(i, QBrush(color),
  						    Qt::BackgroundRole);

Thanks Ceco!
The patch is applied.

Yordan