aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/packet_list.cpp
diff options
context:
space:
mode:
authorRoland Knall <rknall@gmail.com>2017-11-12 11:29:13 +0100
committerRoland Knall <rknall@gmail.com>2017-11-12 17:18:44 +0000
commite13e2df9a1278903c66292a4f7b823c707b30cb3 (patch)
treea1831fd454f638fd1fcd13b6cea763a72deac0ab /ui/qt/packet_list.cpp
parent447291d84a63d3e707fd00111ba465e5c230c849 (diff)
Qt: Rename packetSelection to frameSelected
In order to consolidate the interfaces between certain parts of the UI, the signal emitted after a frame change has occured, has to include the number of the frame. This led to two signals for frame change, and therefore packetSelection is to be removed. Change-Id: I24e0e0890291d2243935b0c48387beb66904bfa3 Reviewed-on: https://code.wireshark.org/review/24377 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/qt/packet_list.cpp')
-rw-r--r--ui/qt/packet_list.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp
index 2c6a26d780..aa49d88275 100644
--- a/ui/qt/packet_list.cpp
+++ b/ui/qt/packet_list.cpp
@@ -484,10 +484,13 @@ void PacketList::selectionChanged (const QItemSelection & selected, const QItemS
if (!cap_file_) return;
+ int row = 0;
+
if (selected.isEmpty()) {
cf_unselect_packet(cap_file_);
} else {
- int row = selected.first().top();
+ /* Framenumbers should allways reflect real frame numbers (can't start at 0) */
+ row = selected.first().top() + 1;
cf_select_packet(cap_file_, row);
}
@@ -501,7 +504,7 @@ void PacketList::selectionChanged (const QItemSelection & selected, const QItemS
related_packet_delegate_.clear();
if (proto_tree_) proto_tree_->clear();
- emit packetSelectionChanged();
+ emit frameSelected(row);
if (!cap_file_->edt) {
viewport()->update();
@@ -537,7 +540,7 @@ void PacketList::selectionChanged (const QItemSelection & selected, const QItemS
cap_file_->edt->tvb);
}
- if (fi && proto_tree_) {
+ if (fi) {
emit fieldSelected(new FieldInformation(fi, this));
}
} else if (!cap_file_->search_in_progress && proto_tree_) {
@@ -588,7 +591,10 @@ void PacketList::contextMenuEvent(QContextMenuEvent *event)
ctx_column_ = columnAt(event->x());
// Set menu sensitivity for the current column and set action data.
- emit packetSelectionChanged();
+ if ( frameData )
+ emit frameSelected(frameData->frameNum());
+ else
+ emit frameSelected(0);
ctx_menu_.exec(event->globalPos());
ctx_column_ = -1;