[vlc-devel] [PATCH] qt medialib: reset history model on history changed

Pierre Lamot pierre at videolabs.io
Thu Dec 17 14:30:46 UTC 2020


---
 modules/gui/qt/medialibrary/mlrecentsmodel.cpp      | 3 +++
 modules/gui/qt/medialibrary/mlrecentsvideomodel.cpp | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/modules/gui/qt/medialibrary/mlrecentsmodel.cpp b/modules/gui/qt/medialibrary/mlrecentsmodel.cpp
index 4351b0c0f2..bca36c9d30 100644
--- a/modules/gui/qt/medialibrary/mlrecentsmodel.cpp
+++ b/modules/gui/qt/medialibrary/mlrecentsmodel.cpp
@@ -83,6 +83,9 @@ void MLRecentsModel::onVlcMlEvent( const MLEvent &event )
 {
     switch ( event.i_type )
     {
+        case VLC_ML_EVENT_HISTORY_CHANGED:
+            emit resetRequested();
+            break;
         case VLC_ML_EVENT_MEDIA_ADDED:
         case VLC_ML_EVENT_MEDIA_UPDATED:
         case VLC_ML_EVENT_MEDIA_DELETED:
diff --git a/modules/gui/qt/medialibrary/mlrecentsvideomodel.cpp b/modules/gui/qt/medialibrary/mlrecentsvideomodel.cpp
index 2085a68d18..f27bb82af2 100644
--- a/modules/gui/qt/medialibrary/mlrecentsvideomodel.cpp
+++ b/modules/gui/qt/medialibrary/mlrecentsvideomodel.cpp
@@ -96,6 +96,9 @@ void MLRecentsVideoModel::onVlcMlEvent( const MLEvent &event )
 {
     switch ( event.i_type )
     {
+        case VLC_ML_EVENT_HISTORY_CHANGED:
+            emit resetRequested();
+            break;
         case VLC_ML_EVENT_MEDIA_ADDED:
         case VLC_ML_EVENT_MEDIA_UPDATED:
         case VLC_ML_EVENT_MEDIA_DELETED:
-- 
2.25.1



More information about the vlc-devel mailing list