[vlc-commits] qt: move default member initialisation in header for MLBaseModel for uniformity

Pierre Lamot git at videolan.org
Mon Jan 4 12:40:39 UTC 2021


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Thu Dec 17 13:32:49 2020 +0100| [778686a932f8b379200c93a6650be36554c542f6] | committer: Pierre Lamot

qt: move default member initialisation in header for MLBaseModel for uniformity

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

 modules/gui/qt/medialibrary/mlbasemodel.cpp | 5 -----
 modules/gui/qt/medialibrary/mlbasemodel.hpp | 8 ++++----
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/modules/gui/qt/medialibrary/mlbasemodel.cpp b/modules/gui/qt/medialibrary/mlbasemodel.cpp
index 794b82198f..4549dacb57 100644
--- a/modules/gui/qt/medialibrary/mlbasemodel.cpp
+++ b/modules/gui/qt/medialibrary/mlbasemodel.cpp
@@ -27,16 +27,11 @@ static constexpr ssize_t COUNT_UNINITIALIZED =
 
 MLBaseModel::MLBaseModel(QObject *parent)
     : QAbstractListModel(parent)
-    , m_ml(nullptr)
     , m_ml_event_handle( nullptr, [this](vlc_ml_event_callback_t* cb ) {
             assert( m_ml != nullptr );
             vlc_ml_event_unregister_callback( m_ml, cb );
         })
-    , m_need_reset( false )
 {
-    m_sort = VLC_ML_SORTING_DEFAULT;
-    m_sort_desc = false;
-
     connect( this, &MLBaseModel::resetRequested, this, &MLBaseModel::onResetRequested );
 }
 
diff --git a/modules/gui/qt/medialibrary/mlbasemodel.hpp b/modules/gui/qt/medialibrary/mlbasemodel.hpp
index faef1c188a..d1057ac6b1 100644
--- a/modules/gui/qt/medialibrary/mlbasemodel.hpp
+++ b/modules/gui/qt/medialibrary/mlbasemodel.hpp
@@ -142,15 +142,15 @@ public:
 protected:
     MLItemId m_parent;
 
-    vlc_medialibrary_t* m_ml;
+    vlc_medialibrary_t* m_ml = nullptr;
     MediaLib* m_mediaLib = nullptr;
     QString m_search_pattern;
-    vlc_ml_sorting_criteria_t m_sort;
-    bool m_sort_desc;
+    vlc_ml_sorting_criteria_t m_sort = VLC_ML_SORTING_DEFAULT;
+    bool m_sort_desc = false;
 
     std::unique_ptr<vlc_ml_event_callback_t,
                     std::function<void(vlc_ml_event_callback_t*)>> m_ml_event_handle;
-    bool m_need_reset;
+    bool m_need_reset = false;
 
     mutable std::unique_ptr<ListCache<std::unique_ptr<MLItem>>> m_cache;
 };



More information about the vlc-commits mailing list