mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-10 13:44:17 +00:00
Use LiStringifyPortFlags() instead of coding it ourselves
This commit is contained in:
parent
c414e1a168
commit
0b56b1685a
1 changed files with 3 additions and 20 deletions
|
@ -158,26 +158,9 @@ public:
|
|||
emit connectionTestCompleted(-1, QString());
|
||||
}
|
||||
else {
|
||||
QString blockedPorts;
|
||||
|
||||
for (int i = 0; i < 32; i++) {
|
||||
if (portTestResult & (1 << i)) {
|
||||
if (!blockedPorts.isEmpty()) {
|
||||
blockedPorts += "\n";
|
||||
}
|
||||
|
||||
if (LiGetProtocolFromPortFlagIndex(i) == 17 /* IPPROTO_UDP */) {
|
||||
blockedPorts += "UDP ";
|
||||
}
|
||||
else {
|
||||
blockedPorts += "TCP ";
|
||||
}
|
||||
|
||||
blockedPorts += QString::number(LiGetPortFromPortFlagIndex(i));
|
||||
}
|
||||
}
|
||||
|
||||
emit connectionTestCompleted(portTestResult, blockedPorts);
|
||||
char blockedPorts[512];
|
||||
LiStringifyPortFlags(portTestResult, "\n", blockedPorts, sizeof(blockedPorts));
|
||||
emit connectionTestCompleted(portTestResult, QString(blockedPorts));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue