kopia lustrzana https://gitlab.com/eliggett/wfview
Fix compile warning
rodzic
db686b1c8b
commit
0b37b1f984
|
@ -341,9 +341,9 @@ void usbController::runTimer()
|
|||
|
||||
// Buttons
|
||||
|
||||
BUTTON* butptt;
|
||||
BUTTON* butf1;
|
||||
BUTTON* butf2;
|
||||
BUTTON* butptt = Q_NULLPTR;
|
||||
BUTTON* butf1 = Q_NULLPTR;
|
||||
BUTTON* butf2 = Q_NULLPTR;;
|
||||
|
||||
for (BUTTON* but = buttonList->begin(); but != buttonList->end(); but++) {
|
||||
if (but->dev == usbDevice) {
|
||||
|
@ -368,7 +368,7 @@ void usbController::runTimer()
|
|||
lastData = data;
|
||||
}
|
||||
|
||||
if (((unsigned char)data[5] == 0x06) && ((unsigned char)lastData[5] != 0x06))
|
||||
if (butptt != Q_NULLPTR && ((unsigned char)data[5] == 0x06) && ((unsigned char)lastData[5] != 0x06))
|
||||
{
|
||||
// TRANSMIT key down only (no other keys down)
|
||||
qDebug(logUsbControl()) << "PTT key down";
|
||||
|
@ -376,7 +376,7 @@ void usbController::runTimer()
|
|||
emit button(butptt->onCommand);
|
||||
|
||||
}
|
||||
else if (((unsigned char)data[5] != 0x06) && ((unsigned char)lastData[5] == 0x06))
|
||||
else if (butptt != Q_NULLPTR && ((unsigned char)data[5] != 0x06) && ((unsigned char)lastData[5] == 0x06))
|
||||
{
|
||||
// TRANSMIT key up only (no other keys down)
|
||||
//emit button(false, 6);
|
||||
|
@ -384,7 +384,7 @@ void usbController::runTimer()
|
|||
qInfo(logUsbControl()) << "Off Button event:" << butptt->offCommand->text;
|
||||
emit button(butptt->offCommand);
|
||||
}
|
||||
else if (((unsigned char)data[5] == 0x03) && ((unsigned char)lastData[5] != 0x03))
|
||||
else if (butf2 != Q_NULLPTR && ((unsigned char)data[5] == 0x03) && ((unsigned char)lastData[5] != 0x03))
|
||||
{
|
||||
// F-2 key up only (no other keys down)
|
||||
//emit button(true, 7);
|
||||
|
@ -392,7 +392,7 @@ void usbController::runTimer()
|
|||
qInfo(logUsbControl()) << "On Button event:" << butf2->onCommand->text;
|
||||
emit button(butf2->onCommand);
|
||||
}
|
||||
else if (((unsigned char)data[5] != 0x03) && ((unsigned char)lastData[5] == 0x03))
|
||||
else if (butf2 != Q_NULLPTR && ((unsigned char)data[5] != 0x03) && ((unsigned char)lastData[5] == 0x03))
|
||||
{
|
||||
// F-2 key down only (no other keys down)
|
||||
//emit button(false, 7);
|
||||
|
@ -400,7 +400,7 @@ void usbController::runTimer()
|
|||
qInfo(logUsbControl()) << "Off Button event:" << butf2->offCommand->text;
|
||||
emit button(butf2->offCommand);
|
||||
}
|
||||
else if (((unsigned char)data[5] == 0x05) && ((unsigned char)lastData[5] != 0x05))
|
||||
else if (butf1 != Q_NULLPTR && ((unsigned char)data[5] == 0x05) && ((unsigned char)lastData[5] != 0x05))
|
||||
{
|
||||
// F-1 key up only (no other keys down)
|
||||
//emit button(true, 5);
|
||||
|
@ -408,7 +408,7 @@ void usbController::runTimer()
|
|||
qInfo(logUsbControl()) << "On Button event:" << butf1->onCommand->text;
|
||||
emit button(butf1->onCommand);
|
||||
}
|
||||
else if (((unsigned char)data[5] != 0x05) && ((unsigned char)lastData[5] == 0x05))
|
||||
else if (butf1 != Q_NULLPTR && ((unsigned char)data[5] != 0x05) && ((unsigned char)lastData[5] == 0x05))
|
||||
{
|
||||
// F-1 key down only (no other keys down)
|
||||
//emit button(false, 5);
|
||||
|
|
Ładowanie…
Reference in New Issue