diff --git a/src/internet/internetsearchmodel.cpp b/src/internet/internetsearchmodel.cpp index e9864f1d7..65cb16be8 100644 --- a/src/internet/internetsearchmodel.cpp +++ b/src/internet/internetsearchmodel.cpp @@ -44,8 +44,7 @@ InternetSearchModel::InternetSearchModel(InternetService *service, QObject *pare proxy_(nullptr), use_pretty_covers_(true), artist_icon_(IconLoader::Load("folder-sound")), - album_icon_(IconLoader::Load("cdcase")) - { + album_icon_(IconLoader::Load("cdcase")) { group_by_[0] = CollectionModel::GroupBy_AlbumArtist; group_by_[1] = CollectionModel::GroupBy_AlbumDisc; @@ -257,8 +256,11 @@ QStandardItem *InternetSearchModel::BuildContainers(const Song &s, QStandardItem // Find a container for this level key->group_[level] = display_text + unique_tag; - QStandardItem *container = containers_[*key]; - if (!container) { + QStandardItem *container = nullptr; + if (containers_.contains(*key)) { + container = containers_[*key]; + } + else { container = new QStandardItem(display_text); container->setData(sort_text, CollectionModel::Role_SortText); container->setData(group_by_[level], CollectionModel::Role_ContainerType); @@ -408,4 +410,3 @@ MimeData *InternetSearchModel::LoadTracks(const InternetSearchView::ResultList & return mime_data; } - diff --git a/src/internet/internetsearchview.cpp b/src/internet/internetsearchview.cpp index c17329dd8..6f9a1e425 100644 --- a/src/internet/internetsearchview.cpp +++ b/src/internet/internetsearchview.cpp @@ -318,9 +318,9 @@ bool InternetSearchView::ResultsContextMenuEvent(QContextMenuEvent *e) { if (!context_menu_) { context_menu_ = new QMenu(this); - context_actions_ << context_menu_->addAction( IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, &InternetSearchView::AddSelectedToPlaylist); - context_actions_ << context_menu_->addAction( IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, &InternetSearchView::LoadSelected); - context_actions_ << context_menu_->addAction( IconLoader::Load("document-new"), tr("Open in new playlist"), this, &InternetSearchView::OpenSelectedInNewPlaylist); + context_actions_ << context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, &InternetSearchView::AddSelectedToPlaylist); + context_actions_ << context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, &InternetSearchView::LoadSelected); + context_actions_ << context_menu_->addAction(IconLoader::Load("document-new"), tr("Open in new playlist"), this, &InternetSearchView::OpenSelectedInNewPlaylist); context_menu_->addSeparator(); context_actions_ << context_menu_->addAction(IconLoader::Load("go-next"), tr("Queue track"), this, &InternetSearchView::AddSelectedToPlaylistEnqueue);