Discard changed events until settings are loaded

This commit is contained in:
Patrick Nicolas
2025-11-02 17:58:21 +01:00
parent a67673327b
commit b383aa4c20
2 changed files with 8 additions and 3 deletions
+5 -2
View File
@@ -15,6 +15,8 @@ Kirigami.ScrollablePage {
flickable.interactive: false // Make sure the Kirigami.ScrollablePage does not eat the vertical mouse dragging events
property bool allowUpdates: false // ignore onXXX events until document is loaded
Settings {
id: config
}
@@ -142,7 +144,7 @@ Kirigami.ScrollablePage {
encoder: Settings.X264
}
]
onCurrentIndexChanged: config.encoder = model[currentIndex].encoder
onCurrentIndexChanged: if (settings.allowUpdates) {config.encoder = model[currentIndex].encoder}
textRole: "label"
Connections {
target: config
@@ -182,7 +184,7 @@ Kirigami.ScrollablePage {
codec: Settings.Av1
}
]
onCurrentIndexChanged: config.codec = model[currentIndex].codec
onCurrentIndexChanged: if (settings.allowUpdates) {config.codec = model[currentIndex].codec}
textRole: "label"
delegate: Controls.ItemDelegate {
@@ -364,6 +366,7 @@ Kirigami.ScrollablePage {
Component.onCompleted: {
openvr_libs.init()
config.load(WivrnServer);
settings.allowUpdates = true;
settings.load();
}
+3 -1
View File
@@ -206,6 +206,7 @@ Settings::encoder_name Settings::encoder() const
void Settings::set_encoder(const encoder_name & value)
{
auto old = encoder();
auto old_codec = codec();
switch (value)
{
case EncoderAuto:
@@ -237,10 +238,11 @@ void Settings::set_encoder(const encoder_name & value)
if (value != old)
{
encoderChanged();
codecChanged();
if (not can10bit())
set_tenbit(false);
}
if (old_codec != codec())
codecChanged();
simpleConfigChanged();
}