Review everything shipped this weekend, and fix what the reviewers caught
Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
@@ -38,9 +38,19 @@ Singleton {
|
||||
// that instead of the live daemon.
|
||||
readonly property string fixturePath: Quickshell.env("PANAMA_SOUND_CARDS_FIXTURE") || ""
|
||||
|
||||
// Assigning `running = true` to a Process that is already running is a
|
||||
// no-op, not a queue, so a refresh that arrived mid-read was simply lost --
|
||||
// and a profile switch's own re-read is exactly the refresh most likely to
|
||||
// land on top of one, leaving the list showing the profile the card no
|
||||
// longer has. Remembered here and re-run from lister.onExited instead.
|
||||
property bool refreshPending: false
|
||||
|
||||
function refresh(): void {
|
||||
if (lister.running)
|
||||
if (lister.running) {
|
||||
root.refreshPending = true;
|
||||
return;
|
||||
}
|
||||
root.refreshPending = false;
|
||||
lister.command = root.fixturePath !== ""
|
||||
? ["cat", root.fixturePath]
|
||||
: ["pactl", "-f", "json", "list", "cards"];
|
||||
@@ -149,6 +159,10 @@ Singleton {
|
||||
root.lastError = "Device profiles could not be read.";
|
||||
root.loaded = true;
|
||||
}
|
||||
// Deferred a turn so this listing's stdout is parsed before the
|
||||
// next one starts filling the same collector.
|
||||
if (root.refreshPending)
|
||||
Qt.callLater(() => root.refresh());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user