Show error dialog for failed SQL queries

This commit is contained in:
Jonas Kvinge
2021-09-09 21:45:46 +02:00
parent 9e624a6c0d
commit d35d3aabc3
24 changed files with 1010 additions and 602 deletions

View File

@@ -603,16 +603,15 @@ void ContextView::SetSong() {
}
if (action_show_albums_->isChecked() && song_prev_.artist() != song_playing_.artist()) {
const QueryOptions opt;
CollectionBackend::AlbumList albumlist;
widget_albums_->albums_model()->Reset();
albumlist = app_->collection_backend()->GetAlbumsByArtist(song_playing_.effective_albumartist(), opt);
albumlist = app_->collection_backend()->GetAlbumsByArtist(song_playing_.effective_albumartist());
if (albumlist.count() > 1) {
label_play_albums_->show();
widget_albums_->show();
label_play_albums_->setText("<b>" + tr("Albums by %1").arg(song_playing_.effective_albumartist().toHtmlEscaped()) + "</b>");
for (const CollectionBackend::Album &album : albumlist) {
SongList songs = app_->collection_backend()->GetAlbumSongs(song_playing_.effective_albumartist(), album.album, opt);
SongList songs = app_->collection_backend()->GetAlbumSongs(song_playing_.effective_albumartist(), album.album);
widget_albums_->albums_model()->AddSongs(songs);
}
spacer_play_albums_->changeSize(20, 10, QSizePolicy::Fixed);