From c6a8f44640d7feb0af97a1a3d9fb14f65cf2d6c8 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 12 Sep 2023 19:28:33 -0500 Subject: [PATCH] Don't set currentIndex to -1 while reinitializing It causes warnings in other code that have property bindings to currentIndex --- app/gui/SettingsView.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/gui/SettingsView.qml b/app/gui/SettingsView.qml index ef6514c7..da6e310d 100644 --- a/app/gui/SettingsView.qml +++ b/app/gui/SettingsView.qml @@ -593,19 +593,20 @@ Flickable { } var saved_fps = StreamingPreferences.fps - currentIndex = -1 + var found = false for (var i = 0; i < model.count; i++) { var el_fps = parseInt(model.get(i).video_fps); // Look for a matching frame rate if (saved_fps === el_fps) { currentIndex = i + found = true break } } // If we didn't find one, add a custom frame rate for the current value - if (currentIndex === -1) { + if (!found) { currentIndex = addRefreshRateOrdered(model, saved_fps, qsTr("Custom (%1 FPS)").arg(saved_fps), true) } else {