mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-08-29 21:40:42 +00:00
Avoid doing non-trivial work in onCheckedChanged on settings page load
This commit is contained in:
+20
-12
@@ -685,11 +685,15 @@ Flickable {
|
|||||||
font.pointSize: 12
|
font.pointSize: 12
|
||||||
checked: prefs.unsupportedFps
|
checked: prefs.unsupportedFps
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
prefs.unsupportedFps = checked
|
// This is called on init, so only do the work if we've
|
||||||
|
// actually changed the value.
|
||||||
|
if (prefs.unsupportedFps != checked) {
|
||||||
|
prefs.unsupportedFps = checked
|
||||||
|
|
||||||
// The selectable FPS values depend on whether
|
// The selectable FPS values depend on whether
|
||||||
// this option is enabled or not
|
// this option is enabled or not
|
||||||
fpsComboBox.reinitialize()
|
fpsComboBox.reinitialize()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -699,16 +703,20 @@ Flickable {
|
|||||||
font.pointSize: 12
|
font.pointSize: 12
|
||||||
checked: prefs.enableMdns
|
checked: prefs.enableMdns
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
prefs.enableMdns = checked
|
// This is called on init, so only do the work if we've
|
||||||
|
// actually changed the value.
|
||||||
|
if (prefs.enableMdns != checked) {
|
||||||
|
prefs.enableMdns = checked
|
||||||
|
|
||||||
// We must save the updated preference to ensure
|
// We must save the updated preference to ensure
|
||||||
// ComputerManager can observe the change internally.
|
// ComputerManager can observe the change internally.
|
||||||
prefs.save()
|
prefs.save()
|
||||||
|
|
||||||
// Restart polling so the mDNS change takes effect
|
// Restart polling so the mDNS change takes effect
|
||||||
if (window.pollingActive) {
|
if (window.pollingActive) {
|
||||||
ComputerManager.stopPollingAsync()
|
ComputerManager.stopPollingAsync()
|
||||||
ComputerManager.startPolling()
|
ComputerManager.startPolling()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user