qs: refactor initialization logic and improve service connections

This commit is contained in:
2026-03-08 22:38:05 +01:00
parent 299188923b
commit 387f8b247b
3 changed files with 11 additions and 6 deletions
@@ -145,8 +145,7 @@ Variants {
}
Connections {
target: LyricsService
onShowLyricsBarChanged: {
function onShowLyricsBarChanged() {
if (LyricsService.showLyricsBar) {
LyricsService.registerComponent("LyricsBar");
SystemStatService.unregisterComponent("BarMonitors");
@@ -155,6 +154,8 @@ Variants {
SystemStatService.registerComponent("BarMonitors");
}
}
target: LyricsService
}
Item {
@@ -8,7 +8,8 @@ pragma Singleton
Singleton {
id: root
property bool loaded: false
property bool dirsLoaded: false
property bool initialized: dirsLoaded && ImageCacheService.initialized && ShellState.isLoaded
Component.onCompleted: {
let mkdirs = "";
@@ -27,7 +28,7 @@ Singleton {
running: false
onExited: (code, status) => {
if (code === 0)
root.loaded = true;
root.dirsLoaded = true;
else
Logger.e("Init", `Failed to create necessary directories: ${code} (${status})`);
}
@@ -12,15 +12,18 @@ ShellRoot {
Component.onCompleted: {
ImageCacheService.init();
SunsetService;
}
Loader {
id: loader
active: Init.loaded && ImageCacheService.initialized && ShellState.isLoaded
active: Init.initialized
sourceComponent: Item {
Component.onCompleted: {
SunsetService;
}
IPCService {
id: ipcService
}