refactor(qbz-qt): split QbzAlbum and QbzArtist out of the God-object

Two singletons rather than one merged object, per the owner: each maps to the
view it backs. Registering them and deleting the duplicates from bridge.rs is
one change, because wiring one without removing the other compiles fine and
leaves two independent states with the view frozen and nothing in the log.

view_param_id goes with them. It had no consumer in QML, verified, and none in
Rust once the two opens stopped writing it — so it is deleted rather than
carried into a new bridge for symmetry's sake.

bridge.rs is down to three domains: settings, search and playlist.

cc
This commit is contained in:
vicrodh committed 2026-07-28 15:24:38 -06:00
1 parent e8a821dd9e
commit ade156a72a
14 files changed
+273 -104

No files matched your search

+6 -6
View File
@@ -34,7 +34,7 @@ Rectangle {
QbzTheme { id: theme }
// The view's album + url-keyed cover map (artwork pipeline).
readonly property var album: JSON.parse(QbzBridge.albumJson)
readonly property var album: JSON.parse(QbzAlbum.albumJson)
readonly property var header: album.header || ({})
readonly property var tracks: album.tracks || []
readonly property var awards: album.awards || []
@@ -234,7 +234,7 @@ Rectangle {
enabled: modelData[1] !== ""
hoverEnabled: true
cursorShape: modelData[1] !== "" ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: QbzBridge.openArtist(modelData[1])
onClicked: QbzArtist.openArtist(modelData[1])
}
}
Text {
@@ -384,7 +384,7 @@ Rectangle {
// Loading.
Item {
visible: QbzBridge.albumLoading && tracks.length === 0
visible: QbzAlbum.albumLoading && tracks.length === 0
width: parent.width
height: 280
Column {
@@ -402,7 +402,7 @@ Rectangle {
// Toolbar — quality badge + track search (+ inert select).
Row {
visible: !QbzBridge.albumLoading
visible: !QbzAlbum.albumLoading
width: parent.width
height: 52
spacing: 16
@@ -494,7 +494,7 @@ Rectangle {
// Column header.
Row {
visible: !QbzBridge.albumLoading
visible: !QbzAlbum.albumLoading
width: parent.width
height: 40
leftPadding: 12
@@ -567,7 +567,7 @@ Rectangle {
enabled: modelData.workComposerId !== ""
hoverEnabled: true
cursorShape: modelData.workComposerId !== "" ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: QbzBridge.openArtist(modelData.workComposerId)
onClicked: QbzArtist.openArtist(modelData.workComposerId)
}
}
Text {