[vlc-commits] [Git][videolan/vlc][master] qml: fix warnings in list view

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Fri Jul 15 17:03:00 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
10e0b4d5 by Prince Gupta at 2022-07-15T16:51:29+00:00
qml: fix warnings in list view

guard against invalid states doesn't work because of missing return
statement

- - - - -


1 changed file:

- modules/gui/qt/widgets/qml/KeyNavigableListView.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/KeyNavigableListView.qml
=====================================
@@ -58,37 +58,37 @@ ListView {
 
     readonly property Item firstVisibleItem: {
         if (transitionsRunning || !delegateItem)
-            null
+            return null
 
         var margin = -root.displayMarginBeginning
         if (orientation === Qt.Vertical) {
             if (headerItem && headerItem.visible && headerPositioning === ListView.OverlayHeader)
                 margin += headerItem.height
 
-            itemAt(contentX + (delegateItem.x + delegateItem.width / 2), contentY + margin)
+            return itemAt(contentX + (delegateItem.x + delegateItem.width / 2), contentY + margin)
         } else {
             if (headerItem && headerItem.visible && headerPositioning === ListView.OverlayHeader)
                 margin += headerItem.width
 
-            itemAt(contentX + margin, contentY + (delegateItem.y + delegateItem.height / 2))
+            return itemAt(contentX + margin, contentY + (delegateItem.y + delegateItem.height / 2))
         }
     }
 
     readonly property Item lastVisibleItem: {
         if (transitionsRunning || !delegateItem)
-            null
+            return null
 
         var margin = -root.displayMarginEnd
         if (orientation === Qt.Vertical) {
             if (footerItem && footerItem.visible && footerPositioning === ListView.OverlayFooter)
                 margin += footerItem.height
 
-            itemAt(contentX + (delegateItem.x + delegateItem.width / 2), contentY + height - margin - 1)
+            return itemAt(contentX + (delegateItem.x + delegateItem.width / 2), contentY + height - margin - 1)
         } else {
             if (footerItem && footerItem.visible && footerPositioning === ListView.OverlayFooter)
                 margin += footerItem.width
 
-            itemAt(contentX + width - margin - 1, contentY + (delegateItem.y + delegateItem.height / 2))
+            return itemAt(contentX + width - margin - 1, contentY + (delegateItem.y + delegateItem.height / 2))
         }
     }
 



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

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