[vlc-commits] qt: use std::make_unique when possible

Alexandre Janniaux git at videolan.org
Thu Dec 5 17:18:03 CET 2019


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Sun Aug 25 20:19:32 2019 +0200| [d40eb012b10cc355ea9ad7a13eaf494b8e826d78] | committer: Thomas Guillem

qt: use std::make_unique when possible

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d40eb012b10cc355ea9ad7a13eaf494b8e826d78
---

 modules/gui/qt/components/mediacenter/mlalbummodel.cpp        | 2 +-
 modules/gui/qt/components/mediacenter/mlalbumtrackmodel.cpp   | 2 +-
 modules/gui/qt/components/mediacenter/mlartistmodel.cpp       | 2 +-
 modules/gui/qt/components/mediacenter/mlgenremodel.cpp        | 2 +-
 modules/gui/qt/components/mediacenter/mlrecentsvideomodel.cpp | 2 +-
 modules/gui/qt/components/mediacenter/mlvideomodel.cpp        | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt/components/mediacenter/mlalbummodel.cpp b/modules/gui/qt/components/mediacenter/mlalbummodel.cpp
index 4b5eca576a..b5ee3f251e 100644
--- a/modules/gui/qt/components/mediacenter/mlalbummodel.cpp
+++ b/modules/gui/qt/components/mediacenter/mlalbummodel.cpp
@@ -89,7 +89,7 @@ std::vector<std::unique_ptr<MLAlbum>> MLAlbumModel::fetch( )
         return {};
     std::vector<std::unique_ptr<MLAlbum>> res;
     for( const vlc_ml_album_t& album: ml_range_iterate<vlc_ml_album_t>( album_list ) )
-        res.emplace_back( new MLAlbum( m_ml, &album ) );
+        res.emplace_back( std::make_unique<MLAlbum>( m_ml, &album ) );
     return res;
 }
 
diff --git a/modules/gui/qt/components/mediacenter/mlalbumtrackmodel.cpp b/modules/gui/qt/components/mediacenter/mlalbumtrackmodel.cpp
index cd1965145d..1107927a76 100644
--- a/modules/gui/qt/components/mediacenter/mlalbumtrackmodel.cpp
+++ b/modules/gui/qt/components/mediacenter/mlalbumtrackmodel.cpp
@@ -130,7 +130,7 @@ std::vector<std::unique_ptr<MLAlbumTrack>> MLAlbumTrackModel::fetch()
         return {};
     std::vector<std::unique_ptr<MLAlbumTrack>> res;
     for( const vlc_ml_media_t& media: ml_range_iterate<vlc_ml_media_t>( media_list ) )
-        res.emplace_back( std::unique_ptr<MLAlbumTrack>{ new MLAlbumTrack( m_ml, &media ) } );
+        res.emplace_back( std::make_unique<MLAlbumTrack>( m_ml, &media ) );
     return res;
 }
 
diff --git a/modules/gui/qt/components/mediacenter/mlartistmodel.cpp b/modules/gui/qt/components/mediacenter/mlartistmodel.cpp
index f60638c512..3994bd9197 100644
--- a/modules/gui/qt/components/mediacenter/mlartistmodel.cpp
+++ b/modules/gui/qt/components/mediacenter/mlartistmodel.cpp
@@ -86,7 +86,7 @@ std::vector<std::unique_ptr<MLArtist>> MLArtistModel::fetch()
         return {};
     std::vector<std::unique_ptr<MLArtist>> res;
     for( const vlc_ml_artist_t& artist: ml_range_iterate<vlc_ml_artist_t>( artist_list ) )
-        res.emplace_back( new MLArtist( &artist ) );
+        res.emplace_back( std::make_unique<MLArtist>( &artist ) );
     return res;
 }
 
diff --git a/modules/gui/qt/components/mediacenter/mlgenremodel.cpp b/modules/gui/qt/components/mediacenter/mlgenremodel.cpp
index cf248411c6..433a8e7cde 100644
--- a/modules/gui/qt/components/mediacenter/mlgenremodel.cpp
+++ b/modules/gui/qt/components/mediacenter/mlgenremodel.cpp
@@ -89,7 +89,7 @@ std::vector<std::unique_ptr<MLGenre>> MLGenreModel::fetch()
         return {};
     std::vector<std::unique_ptr<MLGenre>> res;
     for( const vlc_ml_genre_t& genre: ml_range_iterate<vlc_ml_genre_t>( genre_list ) )
-        res.emplace_back( std::unique_ptr<MLGenre>{ new MLGenre( m_ml, &genre ) } );
+        res.emplace_back( std::make_unique<MLGenre>( m_ml, &genre ) );
     return res;
 }
 
diff --git a/modules/gui/qt/components/mediacenter/mlrecentsvideomodel.cpp b/modules/gui/qt/components/mediacenter/mlrecentsvideomodel.cpp
index b588a9fb00..6fd4fc8d74 100644
--- a/modules/gui/qt/components/mediacenter/mlrecentsvideomodel.cpp
+++ b/modules/gui/qt/components/mediacenter/mlrecentsvideomodel.cpp
@@ -108,7 +108,7 @@ std::vector<std::unique_ptr<MLVideo> > MLRecentsVideoModel::fetch()
         if( media.i_type == VLC_ML_MEDIA_TYPE_VIDEO )
         {
             m_video_count++;
-            res.emplace_back( std::unique_ptr<MLVideo>{ new MLVideo( m_ml, &media ) } );
+            res.emplace_back( std::make_unique<MLVideo>( m_ml, &media ) );
         }
     return res;
 }
diff --git a/modules/gui/qt/components/mediacenter/mlvideomodel.cpp b/modules/gui/qt/components/mediacenter/mlvideomodel.cpp
index c2395ac294..75950b200b 100644
--- a/modules/gui/qt/components/mediacenter/mlvideomodel.cpp
+++ b/modules/gui/qt/components/mediacenter/mlvideomodel.cpp
@@ -117,7 +117,7 @@ std::vector<std::unique_ptr<MLVideo> > MLVideoModel::fetch()
         return {};
     std::vector<std::unique_ptr<MLVideo>> res;
     for( vlc_ml_media_t &media: ml_range_iterate<vlc_ml_media_t>( media_list ) )
-        res.emplace_back( std::unique_ptr<MLVideo>{ new MLVideo(m_ml, &media) } );
+        res.emplace_back( std::make_unique<MLVideo>(m_ml, &media) );
     return res;
 }
 



More information about the vlc-commits mailing list