mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-02-16 02:30:52 +00:00
Move heavy SystemProperties loads to an opt-in model
This avoids heavyweight operations when we're not actually running config checks.
This commit is contained in:
@@ -4,6 +4,7 @@ import QtQuick.Window 2.2
|
||||
|
||||
import SdlGamepadKeyNavigation 1.0
|
||||
import Session 1.0
|
||||
import SystemProperties 1.0
|
||||
|
||||
Item {
|
||||
property Session session
|
||||
@@ -120,6 +121,10 @@ Item {
|
||||
session.sessionFinished.connect(sessionFinished)
|
||||
session.readyForDeletion.connect(sessionReadyForDeletion)
|
||||
|
||||
// Ensure the SystemProperties async thread is finished,
|
||||
// since it may currently be using the SDL video subsystem
|
||||
SystemProperties.waitForAsyncLoad()
|
||||
|
||||
// Kick off the stream
|
||||
spinnerTimer.start()
|
||||
streamLoader.active = true
|
||||
|
||||
@@ -56,13 +56,10 @@ ApplicationWindow {
|
||||
wow64Dialog.open()
|
||||
}
|
||||
|
||||
if (SystemProperties.unmappedGamepads) {
|
||||
unmappedGamepadDialog.unmappedGamepads = SystemProperties.unmappedGamepads
|
||||
unmappedGamepadDialog.open()
|
||||
}
|
||||
|
||||
// Hardware acceleration is checked asynchronously
|
||||
// Hardware acceleration and unmapped gamepads are checked asynchronously
|
||||
SystemProperties.hasHardwareAccelerationChanged.connect(hasHardwareAccelerationChanged)
|
||||
SystemProperties.unmappedGamepadsChanged.connect(hasUnmappedGamepadsChanged)
|
||||
SystemProperties.startAsyncLoad()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +74,13 @@ ApplicationWindow {
|
||||
}
|
||||
}
|
||||
|
||||
function hasUnmappedGamepadsChanged() {
|
||||
if (SystemProperties.unmappedGamepads) {
|
||||
unmappedGamepadDialog.unmappedGamepads = SystemProperties.unmappedGamepads
|
||||
unmappedGamepadDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
// It would be better to use TextMetrics here, but it always lays out
|
||||
// the text slightly more compactly than real Text does in ToolTip,
|
||||
// causing unexpected line breaks to be inserted
|
||||
|
||||
Reference in New Issue
Block a user