mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-13 21:02:28 +00:00
Avoid doing non-trivial work in onCheckedChanged on settings page load
This commit is contained in:
parent
08482577eb
commit
764360c0f3
1 changed files with 20 additions and 12 deletions
|
@ -685,6 +685,9 @@ Flickable {
|
||||||
font.pointSize: 12
|
font.pointSize: 12
|
||||||
checked: prefs.unsupportedFps
|
checked: prefs.unsupportedFps
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
|
// This is called on init, so only do the work if we've
|
||||||
|
// actually changed the value.
|
||||||
|
if (prefs.unsupportedFps != checked) {
|
||||||
prefs.unsupportedFps = checked
|
prefs.unsupportedFps = checked
|
||||||
|
|
||||||
// The selectable FPS values depend on whether
|
// The selectable FPS values depend on whether
|
||||||
|
@ -692,6 +695,7 @@ Flickable {
|
||||||
fpsComboBox.reinitialize()
|
fpsComboBox.reinitialize()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CheckBox {
|
CheckBox {
|
||||||
id: enableMdns
|
id: enableMdns
|
||||||
|
@ -699,6 +703,9 @@ Flickable {
|
||||||
font.pointSize: 12
|
font.pointSize: 12
|
||||||
checked: prefs.enableMdns
|
checked: prefs.enableMdns
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
|
// This is called on init, so only do the work if we've
|
||||||
|
// actually changed the value.
|
||||||
|
if (prefs.enableMdns != checked) {
|
||||||
prefs.enableMdns = checked
|
prefs.enableMdns = checked
|
||||||
|
|
||||||
// We must save the updated preference to ensure
|
// We must save the updated preference to ensure
|
||||||
|
@ -712,6 +719,7 @@ Flickable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CheckBox {
|
CheckBox {
|
||||||
id: quitAppAfter
|
id: quitAppAfter
|
||||||
|
|
Loading…
Reference in a new issue