[vlc-commits] [Git][videolan/vlc][master] 7 commits: qml: fix binding loop in BannerSources

Pierre Lamot gitlab at videolan.org
Fri Jun 4 16:36:32 UTC 2021



Pierre Lamot pushed to branch master at VideoLAN / VLC


Commits:
b2b2cfa8 by Prince Gupta at 2021-06-04T16:03:53+00:00
qml: fix binding loop in BannerSources

- - - - -
2e1d7e29 by Prince Gupta at 2021-06-04T16:03:53+00:00
qml: fix invalid property access in BannerSources

- - - - -
4d35747a by Prince Gupta at 2021-06-04T16:03:53+00:00
qml: fix invalid property access in ExpandGridView

- - - - -
6e65b0e3 by Prince Gupta at 2021-06-04T16:03:53+00:00
qml: fix invalid connection in MusicArtist

parentId property was removed in cd89555e27a3803fa6b485e07922226d01f77ce2

- - - - -
6713884f by Prince Gupta at 2021-06-04T16:03:53+00:00
qml/Helpers: add get function

- - - - -
9f724ba5 by Prince Gupta at 2021-06-04T16:03:53+00:00
qml/AlbumExpandDelegate: fix invalid property accesses

- - - - -
73f0f9f1 by Prince Gupta at 2021-06-04T16:03:53+00:00
qml/VideoExpandDelegate: fix invalid object reference

- - - - -


6 changed files:

- modules/gui/qt/maininterface/qml/BannerSources.qml
- modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
- modules/gui/qt/medialibrary/qml/MusicArtist.qml
- modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml
- modules/gui/qt/util/qml/Helpers.js
- modules/gui/qt/widgets/qml/ExpandGridView.qml


Changes:

=====================================
modules/gui/qt/maininterface/qml/BannerSources.qml
=====================================
@@ -299,7 +299,7 @@ Widgets.NavigableFocusScope {
                                                           - (VLCStyle.applicationHorizontalMargin * 2)
                                                           - (VLCStyle.margin_xsmall * 2)
                                                           - (VLCStyle.margin_xxsmall * 2)
-                    readonly property bool _alignHCenter: ((localToolbar.width - width) / 2) + width < playlistGroup.x
+                    readonly property bool _alignHCenter: ((localToolbar.width - contentWidth) / 2) + contentWidth < playlistGroup.x
 
                     width: Math.min(contentWidth, availableWidth)
                     height: VLCStyle.localToolbar_height
@@ -324,7 +324,7 @@ Widgets.NavigableFocusScope {
                         focus: !!item && item.focus && item.visible
                         visible: !!item
                         enabled: status === Loader.Ready
-                        y: (VLCStyle.localToolbar_height - item.height) / 2
+                        y: status === Loader.Ready ? (VLCStyle.localToolbar_height - item.height) / 2 : 0
                         width: !!item
                                ? Helpers.clamp(localMenuView.availableWidth,
                                                localMenuGroup.item.minimumWidth || localMenuGroup.item.implicitWidth,


=====================================
modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
=====================================
@@ -110,7 +110,7 @@ Widgets.NavigableFocusScope {
                         height: VLCStyle.expandCover_music_height
                         width: VLCStyle.expandCover_music_width
                         radius: VLCStyle.expandCover_music_radius
-                        source: model.cover || VLCStyle.noArtAlbum
+                        source: Helpers.get(model, "cover", VLCStyle.noArtAlbum)
                     }
 
                     Widgets.ListCoverShadow {
@@ -207,7 +207,7 @@ Widgets.NavigableFocusScope {
                     Widgets.SubtitleLabel {
                         id: expand_infos_title_id
 
-                        text: model.title || i18n.qtr("Unknown title")
+                        text: Helpers.get(model, "title", i18n.qtr("Unknown title"))
 
                         Layout.fillWidth: true
                     }
@@ -229,9 +229,9 @@ Widgets.NavigableFocusScope {
 
                     width: parent.width
                     text: i18n.qtr("%1 - %2 - %3")
-                        .arg(model.main_artist || i18n.qtr("Unknown artist"))
-                        .arg(model.release_year || "")
-                        .arg(Helpers.msToString(model.duration) || "")
+                        .arg(Helpers.get(model, "main_artist", i18n.qtr("Unknown artist")))
+                        .arg(Helpers.get(model, "release_year", ""))
+                        .arg(Helpers.msToString(Helpers.get(model, "duration", 0)))
                 }
             }
 
@@ -244,7 +244,7 @@ Widgets.NavigableFocusScope {
             rowHeight: VLCStyle.tableRow_height
             headerColor: VLCStyle.colors.bgAlt
 
-            parentId: root.model.id
+            parentId: Helpers.get(root.model, "id")
             onParentIdChanged: {
                 currentIndex = 0
             }


=====================================
modules/gui/qt/medialibrary/qml/MusicArtist.qml
=====================================
@@ -288,7 +288,7 @@ Widgets.NavigableFocusScope {
             model: albumModel
 
             Connections {
-                target: root
+                target: albumModel
                 // selectionModel updates but doesn't trigger any signal, this forces selection update in view
                 onParentIdChanged: currentIndex = -1
             }


=====================================
modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml
=====================================
@@ -134,7 +134,6 @@ Widgets.NavigableFocusScope {
                         }
 
                         navigationParent: expandRect
-                        navigationRightItem: infoPannelScrollView
                     }
                 }
             }


=====================================
modules/gui/qt/util/qml/Helpers.js
=====================================
@@ -44,3 +44,11 @@ function clamp(num, min, max) {
 function isValidInstanceOf(object, type) {
     return (!!object && (object instanceof type))
 }
+
+// Returns the value associated with the key.
+// If the hash contains no item with the key,
+// or the value is invalid, returns defaultValue
+function get(dict, key, defaultValue) {
+    var v = typeof dict !== "undefined" ? dict[key] : undefined
+    return !v ? defaultValue : v
+}


=====================================
modules/gui/qt/widgets/qml/ExpandGridView.qml
=====================================
@@ -417,7 +417,8 @@ NavigableFocusScope {
 
         Loader {
             id: footerItemLoader
-            focus: item.focus
+
+            focus: status == Loader.Ready ? item.focus : false
             y: root.topMargin + root.headerHeight + (root._effectiveCellHeight * (Math.ceil(model.count / getNbItemsPerRow()))) +
                _expandItemVerticalSpace
         }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7a00ed44fbe19c92778f6beb2ebfc5b5172bde16...73f0f9f10c164f1242cb8ec626242835560e3c0a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7a00ed44fbe19c92778f6beb2ebfc5b5172bde16...73f0f9f10c164f1242cb8ec626242835560e3c0a
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list