[vlc-commits] qt: medialib: remove unused b_is_reloading

Romain Vimont git at videolan.org
Thu Nov 12 15:48:01 CET 2020


vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Mon Nov  9 10:58:09 2020 +0100| [24c94fb93cf7ad54ba2396af67129d2095ba816c] | committer: Alexandre Janniaux

qt: medialib: remove unused b_is_reloading

Signed-off-by: Alexandre Janniaux <ajanni at videolabs.io>

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

 modules/gui/qt/medialibrary/mlbasemodel.cpp | 13 +++----------
 modules/gui/qt/medialibrary/mlbasemodel.hpp |  1 -
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/modules/gui/qt/medialibrary/mlbasemodel.cpp b/modules/gui/qt/medialibrary/mlbasemodel.cpp
index c953d9f421..f5b88da271 100644
--- a/modules/gui/qt/medialibrary/mlbasemodel.cpp
+++ b/modules/gui/qt/medialibrary/mlbasemodel.cpp
@@ -30,7 +30,6 @@ MLBaseModel::MLBaseModel(QObject *parent)
             vlc_ml_event_unregister_callback( m_ml, cb );
         })
     , m_need_reset( false )
-    , m_is_reloading( false )
 {
     vlc_mutex_init( &m_item_lock );
     memset(&m_query_param, 0, sizeof(vlc_ml_query_params_t));
@@ -76,16 +75,10 @@ void MLBaseModel::onVlcMlEvent(const vlc_ml_event_t* event)
     switch(event->i_type)
     {
         case VLC_ML_EVENT_BACKGROUND_IDLE_CHANGED:
-            if ( event->background_idle_changed.b_idle == false )
-                m_is_reloading = true;
-            else
+            if ( event->background_idle_changed.b_idle && m_need_reset )
             {
-                m_is_reloading = false;
-                if ( m_need_reset )
-                {
-                    emit resetRequested();
-                    m_need_reset = false;
-                }
+                emit resetRequested();
+                m_need_reset = false;
             }
             break;
     }
diff --git a/modules/gui/qt/medialibrary/mlbasemodel.hpp b/modules/gui/qt/medialibrary/mlbasemodel.hpp
index 33bce4b4fc..e7bf9e1327 100644
--- a/modules/gui/qt/medialibrary/mlbasemodel.hpp
+++ b/modules/gui/qt/medialibrary/mlbasemodel.hpp
@@ -118,7 +118,6 @@ protected:
     std::unique_ptr<vlc_ml_event_callback_t,
                     std::function<void(vlc_ml_event_callback_t*)>> m_ml_event_handle;
     std::atomic_bool m_need_reset;
-    std::atomic_bool m_is_reloading;
 };
 
 /**



More information about the vlc-commits mailing list