Qt: Fix goto next/prev packet toolbar buttons

Use bitwise AND to check if a modifier bit is set.

Also changed from MetaModifier to AltModifier to match the comment
and the modifier key used in "Next/Previous Packet in History".

Change-Id: I89072a1dfdd14a2beb7344a672cbc18a3ace8924
Reviewed-on: https://code.wireshark.org/review/20359
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Stig Bjørlykke 2017-03-03 08:52:29 +01:00
parent c79b5e0eb7
commit f22964da50
1 changed files with 6 additions and 4 deletions

View File

@ -1167,8 +1167,9 @@ void PacketList::setMonospaceFont(const QFont &mono_font)
header()->setFont(wsApp->font());
}
void PacketList::goNextPacket(void) {
if (QApplication::keyboardModifiers() | Qt::MetaModifier) {
void PacketList::goNextPacket(void)
{
if (QApplication::keyboardModifiers() & Qt::AltModifier) {
// Alt+toolbar
goNextHistoryPacket();
return;
@ -1182,8 +1183,9 @@ void PacketList::goNextPacket(void) {
}
}
void PacketList::goPreviousPacket(void) {
if (QApplication::keyboardModifiers() | Qt::MetaModifier) {
void PacketList::goPreviousPacket(void)
{
if (QApplication::keyboardModifiers() & Qt::AltModifier) {
// Alt+toolbar
goPreviousHistoryPacket();
return;