WebUI: Preserve the network interfaces when down

PR #19286.
This commit is contained in:
Fabricio Silva 2023-07-11 04:23:37 +01:00 committed by GitHub
parent 488464731d
commit f08556be30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View file

@ -320,8 +320,10 @@ void AppController::preferencesAction()
data[u"memory_working_set_limit"_s] = app()->memoryWorkingSetLimit();
// Current network interface
data[u"current_network_interface"_s] = session->networkInterface();
// Current network interface name
data[u"current_interface_name"_s] = session->networkInterfaceName();
// Current network interface address
data[u"current_interface_address"_s] = BitTorrent::Session::instance()->networkInterfaceAddress();
data[u"current_interface_address"_s] = session->networkInterfaceAddress();
// Save resume data interval
data[u"save_resume_data_interval"_s] = session->saveResumeDataInterval();
// Recheck completed torrents
@ -845,7 +847,8 @@ void AppController::setPreferencesAction()
const QString ifaceName = (ifacesIter != ifaces.cend()) ? ifacesIter->humanReadableName() : QString {};
session->setNetworkInterface(ifaceValue);
session->setNetworkInterfaceName(ifaceName);
if (!ifaceName.isEmpty() || ifaceValue.isEmpty())
session->setNetworkInterfaceName(ifaceName);
}
// Current network interface address
if (hasKey(u"current_interface_address"_s))