Phase 2 (make qt_settingsnetwork.cpp filter out the Internal option for machines that do not have an internal NIC - currently that is all machines).

This commit is contained in:
OBattler
2023-10-06 05:30:32 +02:00
parent 79e5a1dfbb
commit 72bd13a8ed

View File

@@ -115,6 +115,12 @@ SettingsNetwork::onCurrentMachineChanged(int machineId)
selectedRow = 0;
while (true) {
/* Skip "internal" if machine doesn't have it. */
if ((c == 1) && (machine_has_flags(machineId, MACHINE_NIC) == 0)) {
c++;
continue;
}
auto name = DeviceConfig::DeviceName(network_card_getdevice(c), network_card_get_internal_name(c), 1);
if (name.isEmpty()) {
break;