fix: artistview nullptr connect warning + album version in header
- Move updateToggleText() after m_list creation to avoid null connects - Show version (e.g. "Deluxe") in album header title Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,6 @@ ArtistSection::ArtistSection(const QString &title, QWidget *parent)
|
||||
" border: none; border-bottom: 1px solid #333; }"
|
||||
"QToolButton:hover { background: #1e1e1e; }"
|
||||
));
|
||||
updateToggleText(0);
|
||||
layout->addWidget(m_toggle);
|
||||
|
||||
m_list = new AlbumListView(this);
|
||||
@@ -38,6 +37,7 @@ ArtistSection::ArtistSection(const QString &title, QWidget *parent)
|
||||
|
||||
connect(m_toggle, &QToolButton::toggled, m_list, &AlbumListView::setVisible);
|
||||
connect(m_list, &AlbumListView::albumSelected, this, &ArtistSection::albumSelected);
|
||||
updateToggleText(0);
|
||||
}
|
||||
|
||||
void ArtistSection::setAlbums(const QJsonArray &albums)
|
||||
|
||||
@@ -119,7 +119,9 @@ public:
|
||||
|
||||
void setAlbum(const QJsonObject &album)
|
||||
{
|
||||
m_title->setText(album["title"].toString());
|
||||
const QString base = album["title"].toString();
|
||||
const QString ver = album["version"].toString().trimmed();
|
||||
m_title->setText(ver.isEmpty() ? base : base + QStringLiteral(" (") + ver + QLatin1Char(')'));
|
||||
m_artistId = static_cast<qint64>(album["artist"].toObject()["id"].toDouble());
|
||||
m_subtitle->setText(album["artist"].toObject()["name"].toString());
|
||||
m_subtitle->setEnabled(m_artistId > 0);
|
||||
|
||||
Reference in New Issue
Block a user