aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Knall <rknall@gmail.com>2017-11-12 21:39:25 +0100
committerAnders Broman <a.broman58@gmail.com>2017-11-13 05:20:52 +0000
commit7c40580584eac67a23633e58810028dddc58781c (patch)
treebc9f67c5cf614167544d4d29c8edb08cf4e6d58e
parent58a44aef230c2d9ddcdca6c892d22e0bd836c9d5 (diff)
Qt: Really fix the packet list selection
Really fix the selection of a row in the packet list Change-Id: I87ab36146bd9b2a130f443717ce73609a1c0b656 Reviewed-on: https://code.wireshark.org/review/24397 Reviewed-by: Roland Knall <rknall@gmail.com> Petri-Dish: Roland Knall <rknall@gmail.com> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--ui/qt/packet_list.cpp4
-rw-r--r--ui/qt/utils/frame_information.cpp4
-rw-r--r--ui/qt/utils/frame_information.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp
index 393f2d4..20d9edf 100644
--- a/ui/qt/packet_list.cpp
+++ b/ui/qt/packet_list.cpp
@@ -484,7 +484,7 @@ void PacketList::selectionChanged (const QItemSelection & selected, const QItemS
if (!cap_file_) return;
- int row = 0;
+ int row = -1;
if (selected.isEmpty()) {
cf_unselect_packet(cap_file_);
@@ -593,7 +593,7 @@ void PacketList::contextMenuEvent(QContextMenuEvent *event)
if ( frameData )
emit frameSelected(frameData->frameNum());
else
- emit frameSelected(0);
+ emit frameSelected(-1);
ctx_menu_.exec(event->globalPos());
ctx_column_ = -1;
diff --git a/ui/qt/utils/frame_information.cpp b/ui/qt/utils/frame_information.cpp
index 303076b..c81b673 100644
--- a/ui/qt/utils/frame_information.cpp
+++ b/ui/qt/utils/frame_information.cpp
@@ -89,10 +89,10 @@ frame_data * FrameInformation::frameData() const
return fi_;
}
-unsigned int FrameInformation::frameNum() const
+int FrameInformation::frameNum() const
{
if ( ! fi_ )
- return 0;
+ return -1;
return fi_->num;
}
diff --git a/ui/qt/utils/frame_information.h b/ui/qt/utils/frame_information.h
index 01a2234..86b4858 100644
--- a/ui/qt/utils/frame_information.h
+++ b/ui/qt/utils/frame_information.h
@@ -49,7 +49,7 @@ public:
bool isValid();
frame_data * frameData() const;
- unsigned int frameNum() const;
+ int frameNum() const;
QByteArray printableData();