[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: fix promise `then()` never called in `PlaylistMediaList.qml`

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Feb 1 12:03:26 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
a8424fd7 by Fatih Uzunoglu at 2025-02-01T11:36:01+00:00
qml: fix promise `then()` never called in `PlaylistMediaList.qml`

This causes the cursor to remain busy forever.

- - - - -
093cb463 by Fatih Uzunoglu at 2025-02-01T11:36:01+00:00
qml: show the busy cursor also in grid mode in `PlaylistMediaList.qml`

- - - - -


1 changed file:

- modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml


Changes:

=====================================
modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml
=====================================
@@ -155,14 +155,15 @@ MainViewLoader {
     function _dropAction(drop, index) {
         const item = drop.source
         if (Helpers.isValidInstanceOf(item, Widgets.DragItem)) {
-            item.getSelectedInputItem().then(inputItems => {
+            drop.accepted = true
+            return item.getSelectedInputItem().then(inputItems => {
                 if (index === undefined)
                     DialogsProvider.playlistsDialog(inputItems)
                 else
                     root.model.append(root.model.getItemId(index), inputItems)
             })
-            drop.accepted = true
         } else if (drop.hasUrls) {
+            drop.accepted = true
             const urlList = []
             for (let url in drop.urls)
                 urlList.push(drop.urls[url])
@@ -170,10 +171,10 @@ MainViewLoader {
                 DialogsProvider.playlistsDialog(inputItems)
             else
                 root.model.append(root.model.getItemId(index), urlList)
-            drop.accepted = true
         } else {
             drop.accepted = false
         }
+        return Promise.resolve()
     }
 
     //---------------------------------------------------------------------------------------------
@@ -314,9 +315,19 @@ MainViewLoader {
                     }
 
                     onDropped: function(drop) {
-                        root._dropAction(drop, index)
+                        MainCtx.setCursor(gridView, Qt.BusyCursor)
+                        root._dropAction(drop, index).then(() => {
+                            if (gridView)
+                                MainCtx.unsetCursor(gridView)
+                        })
                     }
                 }
+
+                Component.onCompleted: {
+                    // Qt Quick Button sets a cursor for itself, unset it so that if the view has
+                    // busy cursor, it is visible over the delegate:
+                    MainCtx.unsetCursor(this)
+                }
             }
 
             //-------------------------------------------------------------------------------------
@@ -409,8 +420,7 @@ MainViewLoader {
             }
 
             listView.acceptDropFunc: function(index, drop) {
-                return new Promise(() => { root._dropAction(drop,
-                                                            listView.itemContainsDrag.index) } )
+                return root._dropAction(drop, listView.itemContainsDrag.index)
             }
 
             listView.dropIndicator: null



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/32a0be32f89dfa124a423b76846caf93da43be04...093cb463f687f36d887d89882cac70cded55c3d4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/32a0be32f89dfa124a423b76846caf93da43be04...093cb463f687f36d887d89882cac70cded55c3d4
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