[vlc-commits] [Git][videolan/vlc][master] qt: don't return cache count as uninitialised while fetching new data

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Jun 23 18:45:46 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
dd7f2e35 by Pierre Lamot at 2023-06-23T18:19:27+00:00
qt: don't return cache count as uninitialised while fetching new data

New count and data is being fetched asynchronously, old data is still available,
return its count.

This avoids flickering effect in views  when new data appears as
MLBaseModel.isReady became false when cache was updated

- - - - -


1 changed file:

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


Changes:

=====================================
modules/gui/qt/medialibrary/mllistcache.cpp
=====================================
@@ -256,9 +256,12 @@ void MLListCache::deleteRange(int first, int last)
 
 ssize_t MLListCache::count() const
 {
-    if (!m_cachedData)
-        return -1;
-    return m_cachedData->totalCount;
+    if (m_cachedData)
+        return m_cachedData->totalCount;
+    else if (m_oldData)
+        return m_oldData->totalCount;
+    else
+        return COUNT_UNINITIALIZED;
 }
 
 void MLListCache::initCount()



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

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