Use std::make_unique / std::make_shared

This commit is contained in:
Jonas Kvinge
2021-07-01 01:56:35 +02:00
parent 0e8ae1a206
commit b9f3f80d50
4 changed files with 21 additions and 20 deletions

View File

@@ -174,7 +174,8 @@ void SystemTrayIcon::SetTrayiconProgress(const bool enabled) {
void SystemTrayIcon::SetupMenu(QAction *previous, QAction *play, QAction *stop, QAction *stop_after, QAction *next, QAction *mute, QAction *love, QAction *quit) {
p_.reset(new MacSystemTrayIconPrivate());
p_ = std::make_unique<MacSystemTrayIconPrivate>();
SetupMenuItem(previous);
SetupMenuItem(play);
SetupMenuItem(stop);

View File

@@ -110,7 +110,7 @@ PlaylistItemList DoRunSearch(PlaylistGeneratorPtr gen) { return gen->Generate();
void SmartPlaylistSearchPreview::RunSearch(const SmartPlaylistSearch &search) {
generator_.reset(new PlaylistQueryGenerator);
generator_ = std::make_shared<PlaylistQueryGenerator>();
generator_->set_collection(backend_);
std::dynamic_pointer_cast<PlaylistQueryGenerator>(generator_)->Load(search);