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:
parent
cd9aceb62c
commit
d2fa488979
4 changed files with 82 additions and 51 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue