[vlc-commits] [Git][videolan/vlc][master] qt: reset ml specific cache with loader cache

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Jan 12 14:34:54 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
3b120c4a by Prince Gupta at 2024-01-12T14:13:56+00:00
qt: reset ml specific cache with loader cache

fixes #28475

- - - - -


2 changed files:

- modules/gui/qt/medialibrary/mlbasemodel.cpp
- modules/gui/qt/medialibrary/mlbasemodel.hpp


Changes:

=====================================
modules/gui/qt/medialibrary/mlbasemodel.cpp
=====================================
@@ -57,6 +57,16 @@ public:
         : Parent(pub)
     {}
 
+    void validateCache() const
+    {
+        Q_Q(const MLBaseModel);
+
+        // this will cancel all queued up loadItemsTask and related ML specific operations
+        q->m_itemLoader = nullptr;
+
+        Parent::validateCache();
+    }
+
     virtual std::unique_ptr<ListCacheLoader<std::unique_ptr<MLItem>>> createLoader() const override
     {
         Q_Q(const MLBaseModel);


=====================================
modules/gui/qt/medialibrary/mlbasemodel.hpp
=====================================
@@ -142,7 +142,7 @@ protected:
 
 
     //loader used to load single items
-    std::shared_ptr<MLListCacheLoader> m_itemLoader;
+    mutable std::shared_ptr<MLListCacheLoader> m_itemLoader;
 
     friend class MLListCacheLoader;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3b120c4ac275071a22a2324abce1e86a10037a13

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3b120c4ac275071a22a2324abce1e86a10037a13
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