[vlc-commits] [Git][videolan/vlc][master] qt: mlplaylistlistmodel: don't do requested transaction if another one is processing

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Nov 27 13:58:15 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
15449b68 by Steve Lhomme at 2025-11-27T13:33:22+00:00
qt: mlplaylistlistmodel: don't do requested transaction if another one is processing

It looks more like a failure that way.

- - - - -


2 changed files:

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


Changes:

=====================================
modules/gui/qt/medialibrary/mlplaylistlistmodel.cpp
=====================================
@@ -121,11 +121,9 @@ void appendMediaIntoPlaylist(vlc_medialibrary_t* ml, int64_t playlistId, const s
     assert(m_mediaLib);
     assert(ids.size() > 0);
 
-    if (unlikely(m_transactionPending))
+    if (unlikely(!setTransactionPending(true)))
         return;
 
-    setTransactionPending(true);
-
     m_mediaLib->runOnMLThread(this,
     //ML thread
     [playlistId, ids](vlc_medialibrary_t* ml) {
@@ -179,11 +177,9 @@ void appendMediaIntoPlaylist(vlc_medialibrary_t* ml, int64_t playlistId, const s
 {
     assert(m_mediaLib);
 
-    if (unlikely(m_transactionPending))
+    if (unlikely(!setTransactionPending(true)))
         return false;
 
-    setTransactionPending(true);
-
     std::vector<MLItemId> itemList;
     for (const QVariant & id : ids)
     {
@@ -341,10 +337,10 @@ void MLPlaylistListModel::endTransaction()
     setTransactionPending(false);
 }
 
-void MLPlaylistListModel::setTransactionPending(const bool value)
+bool MLPlaylistListModel::setTransactionPending(const bool value)
 {
     if (m_transactionPending == value)
-        return;
+        return false;
 
     m_transactionPending = value;
 
@@ -358,6 +354,7 @@ void MLPlaylistListModel::setTransactionPending(const bool value)
     }
 
     emit transactionPendingChanged(value);
+    return true;
 }
 
 QString MLPlaylistListModel::getCover(const MLPlaylist * playlist) const


=====================================
modules/gui/qt/medialibrary/mlplaylistlistmodel.hpp
=====================================
@@ -96,7 +96,7 @@ private: // Functions
 
     void endTransaction();
 
-    void setTransactionPending(bool);
+    bool setTransactionPending(bool);
 
 private: // MLBaseModel implementation
     void onVlcMlEvent(const MLEvent & event) override;



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

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