diff options
author | german77 <juangerman-13@hotmail.com> | 2022-09-09 22:29:22 +0200 |
---|---|---|
committer | FearlessTobi <thm.frey@gmail.com> | 2022-09-10 19:39:25 +0200 |
commit | 8f207bd93ddb9778f0242fca0dab6ef155bd2a97 (patch) | |
tree | ba3035c2a2b304956f6ba2ae6d5ac47d64c1ce52 /src/core/internal_network | |
parent | ldn: Initial implementation (diff) | |
download | yuzu-8f207bd93ddb9778f0242fca0dab6ef155bd2a97.tar yuzu-8f207bd93ddb9778f0242fca0dab6ef155bd2a97.tar.gz yuzu-8f207bd93ddb9778f0242fca0dab6ef155bd2a97.tar.bz2 yuzu-8f207bd93ddb9778f0242fca0dab6ef155bd2a97.tar.lz yuzu-8f207bd93ddb9778f0242fca0dab6ef155bd2a97.tar.xz yuzu-8f207bd93ddb9778f0242fca0dab6ef155bd2a97.tar.zst yuzu-8f207bd93ddb9778f0242fca0dab6ef155bd2a97.zip |
Diffstat (limited to 'src/core/internal_network')
-rw-r--r-- | src/core/internal_network/network_interface.cpp | 10 | ||||
-rw-r--r-- | src/core/internal_network/network_interface.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/core/internal_network/network_interface.cpp b/src/core/internal_network/network_interface.cpp index 0f0a66160..858ae1cfb 100644 --- a/src/core/internal_network/network_interface.cpp +++ b/src/core/internal_network/network_interface.cpp @@ -206,4 +206,14 @@ std::optional<NetworkInterface> GetSelectedNetworkInterface() { return *res; } +void SelectFirstNetworkInterface() { + const auto network_interfaces = Network::GetAvailableNetworkInterfaces(); + + if (network_interfaces.size() == 0) { + return; + } + + Settings::values.network_interface.SetValue(network_interfaces[0].name); +} + } // namespace Network diff --git a/src/core/internal_network/network_interface.h b/src/core/internal_network/network_interface.h index 9b98b6b42..175e61b1f 100644 --- a/src/core/internal_network/network_interface.h +++ b/src/core/internal_network/network_interface.h @@ -24,5 +24,6 @@ struct NetworkInterface { std::vector<NetworkInterface> GetAvailableNetworkInterfaces(); std::optional<NetworkInterface> GetSelectedNetworkInterface(); +void SelectFirstNetworkInterface(); } // namespace Network |