[vlc-commits] [Git][videolan/vlc][master] qt/mlvideofoldersmodel: Add FOLDER events support

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Sun Mar 6 16:05:36 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
0efc5999 by Benjamin Arnaud at 2022-03-06T15:38:42+00:00
qt/mlvideofoldersmodel: Add FOLDER events support

- - - - -


1 changed file:

- modules/gui/qt/medialibrary/mlvideofoldersmodel.cpp


Changes:

=====================================
modules/gui/qt/medialibrary/mlvideofoldersmodel.cpp
=====================================
@@ -129,7 +129,23 @@ ListCacheLoader<std::unique_ptr<MLItem>> * MLVideoFoldersModel::createLoader() c
 
 void MLVideoFoldersModel::onVlcMlEvent(const MLEvent & event) /* override */
 {
-    // FIXME: Add support for folder events once the MediaLibrary supports them.
+    int type = event.i_type;
+
+    switch (type)
+    {
+        case VLC_ML_EVENT_FOLDER_ADDED:
+        case VLC_ML_EVENT_FOLDER_UPDATED:
+        case VLC_ML_EVENT_FOLDER_DELETED:
+        {
+            m_need_reset = true;
+
+            emit resetRequested();
+
+            break;
+        }
+        default:
+            break;
+    }
 
     MLBaseModel::onVlcMlEvent(event);
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0efc599969928c5b05c7c905ec1087444a5cc5e0

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0efc599969928c5b05c7c905ec1087444a5cc5e0
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list