@@ -374,8 +374,16 @@ void AppController::preferencesAction()
374
374
data[u" resolve_peer_countries" _s] = pref->resolvePeerCountries ();
375
375
// Reannounce to all trackers when ip/port changed
376
376
data[u" reannounce_when_address_changed" _s] = session->isReannounceWhenAddressChangedEnabled ();
377
+ // Embedded tracker
378
+ data[u" enable_embedded_tracker" _s] = session->isTrackerEnabled ();
379
+ data[u" embedded_tracker_port" _s] = pref->getTrackerPort ();
380
+ data[u" embedded_tracker_port_forwarding" _s] = pref->isTrackerPortForwardingEnabled ();
381
+ // Mark-of-the-Web
382
+ data[u" mark_of_the_web" _s] = pref->isMarkOfTheWebEnabled ();
377
383
// Ignore SSL errors
378
384
data[u" ignore_ssl_errors" _s] = pref->isIgnoreSSLErrors ();
385
+ // Python executable path
386
+ data[u" python_executable_path" _s] = pref->getPythonExecutablePath ().toString ();
379
387
380
388
// libtorrent preferences
381
389
// Bdecode depth limit
@@ -438,14 +446,6 @@ void AppController::preferencesAction()
438
446
data[u" ssrf_mitigation" _s] = session->isSSRFMitigationEnabled ();
439
447
// Disallow connection to peers on privileged ports
440
448
data[u" block_peers_on_privileged_ports" _s] = session->blockPeersOnPrivilegedPorts ();
441
- // Embedded tracker
442
- data[u" enable_embedded_tracker" _s] = session->isTrackerEnabled ();
443
- data[u" embedded_tracker_port" _s] = pref->getTrackerPort ();
444
- data[u" embedded_tracker_port_forwarding" _s] = pref->isTrackerPortForwardingEnabled ();
445
- // Mark-of-the-Web
446
- data[u" mark_of_the_web" _s] = pref->isMarkOfTheWebEnabled ();
447
- // Python executable path
448
- data[u" python_executable_path" _s] = pref->getPythonExecutablePath ().toString ();
449
449
// Choking algorithm
450
450
data[u" upload_slots_behavior" _s] = static_cast <int >(session->chokingAlgorithm ());
451
451
// Seed choking algorithm
@@ -984,9 +984,22 @@ void AppController::setPreferencesAction()
984
984
// Reannounce to all trackers when ip/port changed
985
985
if (hasKey (u" reannounce_when_address_changed" _s))
986
986
session->setReannounceWhenAddressChangedEnabled (it.value ().toBool ());
987
+ // Embedded tracker
988
+ if (hasKey (u" embedded_tracker_port" _s))
989
+ pref->setTrackerPort (it.value ().toInt ());
990
+ if (hasKey (u" embedded_tracker_port_forwarding" _s))
991
+ pref->setTrackerPortForwardingEnabled (it.value ().toBool ());
992
+ if (hasKey (u" enable_embedded_tracker" _s))
993
+ session->setTrackerEnabled (it.value ().toBool ());
994
+ // Mark-of-the-Web
995
+ if (hasKey (u" mark_of_the_web" _s))
996
+ pref->setMarkOfTheWebEnabled (it.value ().toBool ());
987
997
// Ignore SLL errors
988
998
if (hasKey (u" ignore_ssl_errors" _s))
989
999
pref->setIgnoreSSLErrors (it.value ().toBool ());
1000
+ // Python executable path
1001
+ if (hasKey (u" python_executable_path" _s))
1002
+ pref->setPythonExecutablePath (Path (it.value ().toString ()));
990
1003
991
1004
// libtorrent preferences
992
1005
// Bdecode depth limit
@@ -1081,19 +1094,6 @@ void AppController::setPreferencesAction()
1081
1094
// Disallow connection to peers on privileged ports
1082
1095
if (hasKey (u" block_peers_on_privileged_ports" _s))
1083
1096
session->setBlockPeersOnPrivilegedPorts (it.value ().toBool ());
1084
- // Embedded tracker
1085
- if (hasKey (u" embedded_tracker_port" _s))
1086
- pref->setTrackerPort (it.value ().toInt ());
1087
- if (hasKey (u" embedded_tracker_port_forwarding" _s))
1088
- pref->setTrackerPortForwardingEnabled (it.value ().toBool ());
1089
- if (hasKey (u" enable_embedded_tracker" _s))
1090
- session->setTrackerEnabled (it.value ().toBool ());
1091
- // Mark-of-the-Web
1092
- if (hasKey (u" mark_of_the_web" _s))
1093
- pref->setMarkOfTheWebEnabled (it.value ().toBool ());
1094
- // Python executable path
1095
- if (hasKey (u" python_executable_path" _s))
1096
- pref->setPythonExecutablePath (Path (it.value ().toString ()));
1097
1097
// Choking algorithm
1098
1098
if (hasKey (u" upload_slots_behavior" _s))
1099
1099
session->setChokingAlgorithm (static_cast <BitTorrent::ChokingAlgorithm>(it.value ().toInt ()));
0 commit comments