qt: remove org.videolan.compat module

This commit is contained in:
Fatih Uzunoglu 2024-01-11 20:40:43 +02:00 committed by Jean-Baptiste Kempf
parent 83141455ea
commit 30c2634e72
27 changed files with 24 additions and 177 deletions

View File

@ -1025,14 +1025,10 @@ libqt_plugin_la_QML = \
util/qml/ModelSortSettingHandler.qml \ util/qml/ModelSortSettingHandler.qml \
util/qml/FlickableScrollHandler.qml \ util/qml/FlickableScrollHandler.qml \
util/qml/ViewDragAutoScrollHandler.qml \ util/qml/ViewDragAutoScrollHandler.qml \
util/qml/BindingRev8.qml \
util/qml/BindingRev14.qml \
util/qml/FSM.qml \ util/qml/FSM.qml \
util/qml/FSMState.qml \ util/qml/FSMState.qml \
util/qml/NativeMenu.qml \ util/qml/NativeMenu.qml \
util/qml/MLContextMenu.qml \ util/qml/MLContextMenu.qml \
util/qml/ListViewRev15.qml \
util/qml/ListViewRev11.qml \
util/qml/FadeControllerStateGroup.qml \ util/qml/FadeControllerStateGroup.qml \
widgets/qml/ActionButtonOverlay.qml \ widgets/qml/ActionButtonOverlay.qml \
widgets/qml/ActionButtonPrimary.qml \ widgets/qml/ActionButtonPrimary.qml \

View File

@ -22,7 +22,6 @@ import QtQuick.Layouts 1.12
import QtQml.Models 2.12 import QtQml.Models 2.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///player/" import "qrc:///player/"
import "qrc:///widgets/" as Widgets import "qrc:///widgets/" as Widgets
@ -108,7 +107,7 @@ Control {
} }
} }
BindingCompat { Binding {
when: dragActive when: dragActive
value: true value: true

View File

@ -20,7 +20,6 @@ import QtQuick.Controls 2.12
import QtQml.Models 2.12 import QtQml.Models 2.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///style/" import "qrc:///style/"
import "qrc:///util/" as Util import "qrc:///util/" as Util
@ -118,7 +117,7 @@ ListView {
implicitHeight: VLCStyle.icon_medium implicitHeight: VLCStyle.icon_medium
BindingCompat on implicitWidth { Binding on implicitWidth {
delayed: true delayed: true
value: Math.max(implicitHeight, playerBtnDND.width - x) value: Math.max(implicitHeight, playerBtnDND.width - x)
} }
@ -167,7 +166,7 @@ ListView {
anchors.verticalCenter: parent ? parent.verticalCenter : undefined anchors.verticalCenter: parent ? parent.verticalCenter : undefined
dndView: playerBtnDND dndView: playerBtnDND
BindingCompat { Binding {
when: dropArea.containsDrag when: dropArea.containsDrag
value: true value: true

View File

@ -320,31 +320,6 @@ void MainUI::registerQMLTypes()
qmlProtectModule(uri, versionMajor); qmlProtectModule(uri, versionMajor);
} }
{
const char* const uri = "org.videolan.compat";
const int versionMajor = 0;
const int versionMinor = 1;
qmlRegisterModule(uri, versionMajor, versionMinor);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
qmlRegisterType(QUrl("qrc:///util/BindingRev14.qml"), uri, versionMajor, versionMinor, "BindingCompat");
#else
qmlRegisterType(QUrl("qrc:///util/BindingRev8.qml"), uri, versionMajor, versionMinor, "BindingCompat");
#endif
qmlRegisterType(QUrl(QStringLiteral(
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
"qrc:///util/ListViewRev15.qml"
#else
"qrc:///util/ListViewRev11.qml"
#endif
)),
uri, versionMajor, versionMinor, "ListViewCompat");
qmlProtectModule(uri, versionMajor);
}
{ {
// Custom controls // Custom controls

View File

@ -25,7 +25,6 @@ import QtQml.Models 2.12
import QtQuick.Window 2.12 import QtQuick.Window 2.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///style/" import "qrc:///style/"
import "qrc:///playlist/" as PL import "qrc:///playlist/" as PL
@ -69,7 +68,7 @@ T.ToolBar {
colorSet: ColorContext.Window colorSet: ColorContext.Window
} }
BindingCompat { Binding {
target: MainCtx.search target: MainCtx.search
property: "pattern" property: "pattern"
value: searchBox.searchPattern value: searchBox.searchPattern

View File

@ -21,7 +21,6 @@ import QtQuick.Layouts 1.12
import QtGraphicalEffects 1.12 import QtGraphicalEffects 1.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///style/" import "qrc:///style/"
import "qrc:///main/" as Main import "qrc:///main/" as Main

View File

@ -23,7 +23,6 @@ import QtQuick.Window 2.12
import QtGraphicalEffects 1.12 import QtGraphicalEffects 1.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///widgets/" as Widgets import "qrc:///widgets/" as Widgets
import "qrc:///style/" import "qrc:///style/"
@ -91,19 +90,19 @@ Item {
anchors.rightMargin: MainCtx.windowExtendedMargin anchors.rightMargin: MainCtx.windowExtendedMargin
anchors.bottomMargin: MainCtx.windowExtendedMargin anchors.bottomMargin: MainCtx.windowExtendedMargin
BindingCompat { Binding {
target: VLCStyle target: VLCStyle
property: "appWidth" property: "appWidth"
value: g_mainInterface.width value: g_mainInterface.width
} }
BindingCompat { Binding {
target: VLCStyle target: VLCStyle
property: "appHeight" property: "appHeight"
value: g_mainInterface.height value: g_mainInterface.height
} }
BindingCompat { Binding {
target: MainCtx target: MainCtx
property: "windowExtendedMargin" property: "windowExtendedMargin"
value: _extendedFrameVisible ? VLCStyle.dp(20, VLCStyle.scale) : 0 value: _extendedFrameVisible ? VLCStyle.dp(20, VLCStyle.scale) : 0

View File

@ -23,7 +23,6 @@ import QtQuick.Layouts 1.12
import QtQml.Models 2.12 import QtQml.Models 2.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///style/" import "qrc:///style/"
import "qrc:///widgets/" as Widgets import "qrc:///widgets/" as Widgets

View File

@ -22,7 +22,6 @@ import QtQuick.Layouts 1.12
import QtQml.Models 2.12 import QtQml.Models 2.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///style/" import "qrc:///style/"
import "qrc:///widgets/" as Widgets import "qrc:///widgets/" as Widgets
@ -38,7 +37,7 @@ FocusScope {
// The wise thing to do would be to not // The wise thing to do would be to not
// delay if the sizes are ready. // delay if the sizes are ready.
BindingCompat on Layout.minimumWidth { Binding on Layout.minimumWidth {
delayed: true delayed: true
when: controlLayout._componentCompleted when: controlLayout._componentCompleted
value: { value: {
@ -62,7 +61,7 @@ FocusScope {
} }
} }
BindingCompat on Layout.maximumWidth { Binding on Layout.maximumWidth {
delayed: true delayed: true
when: controlLayout._componentCompleted when: controlLayout._componentCompleted
value: { value: {

View File

@ -20,7 +20,6 @@ import QtQuick.Layouts 1.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
Repeater { Repeater {
id: repeater id: repeater
@ -64,7 +63,7 @@ Repeater {
Layout.alignment: repeater.alignment Layout.alignment: repeater.alignment
BindingCompat on visible { Binding on visible {
delayed: true // this is important delayed: true // this is important
value: (loader.x + loader.Layout.minimumWidth <= repeater.availableWidth) value: (loader.x + loader.Layout.minimumWidth <= repeater.availableWidth)
} }

View File

@ -18,7 +18,6 @@
import QtQuick 2.12 import QtQuick 2.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///style/" import "qrc:///style/"
@ -54,7 +53,7 @@ ControlBar {
} }
} }
BindingCompat on _delayedImplicitHeight { Binding on _delayedImplicitHeight {
// eliminate intermediate adjustments until implicit height is calculated fully // eliminate intermediate adjustments until implicit height is calculated fully
// we can not delay on component load because we do not want twitching // we can not delay on component load because we do not want twitching
// NOTE: The delay here can be removed, as long as a direct height is set // NOTE: The delay here can be removed, as long as a direct height is set

View File

@ -23,7 +23,6 @@ import QtGraphicalEffects 1.12
import QtQuick.Window 2.12 import QtQuick.Window 2.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///style/" import "qrc:///style/"
import "qrc:///widgets/" as Widgets import "qrc:///widgets/" as Widgets
@ -443,7 +442,7 @@ FocusScope {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.topMargin: VLCStyle.margin_xxlarge Layout.topMargin: VLCStyle.margin_xxlarge
BindingCompat on visible { Binding on visible {
delayed: true delayed: true
when: albumLabel.componentCompleted when: albumLabel.componentCompleted
value: centerContent.height > (albumLabel.y + albumLabel.height) value: centerContent.height > (albumLabel.y + albumLabel.height)
@ -468,7 +467,7 @@ FocusScope {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.topMargin: VLCStyle.margin_small Layout.topMargin: VLCStyle.margin_small
BindingCompat on visible { Binding on visible {
delayed: true delayed: true
when: artistLabel.componentCompleted when: artistLabel.componentCompleted
value: centerContent.height > (artistLabel.y + artistLabel.height) value: centerContent.height > (artistLabel.y + artistLabel.height)
@ -493,7 +492,7 @@ FocusScope {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.topMargin: VLCStyle.margin_large Layout.topMargin: VLCStyle.margin_large
BindingCompat on visible { Binding on visible {
delayed: true delayed: true
when: audioControls.componentCompleted when: audioControls.componentCompleted
value: Player.videoTracks.count === 0 && centerContent.height > (audioControls.y + audioControls.height) value: Player.videoTracks.count === 0 && centerContent.height > (audioControls.y + audioControls.height)

View File

@ -20,7 +20,6 @@ import QtQuick 2.12
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///style/" import "qrc:///style/"
import "qrc:///widgets/" as Widgets import "qrc:///widgets/" as Widgets
@ -220,7 +219,7 @@ FocusScope {
// TODO: "ControlListFilter"'s count...... // TODO: "ControlListFilter"'s count......
active: !!playerControlLayout.model && !!playerControlLayout.model.center && (playerControlLayout.model.center.count > 0) active: !!playerControlLayout.model && !!playerControlLayout.model.center && (playerControlLayout.model.center.count > 0)
BindingCompat on width { Binding on width {
delayed: true delayed: true
when: loaderCenter._componentCompleted when: loaderCenter._componentCompleted
value: { value: {

View File

@ -21,7 +21,6 @@ import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///widgets/" as Widgets import "qrc:///widgets/" as Widgets
import "qrc:///style/" import "qrc:///style/"
@ -162,7 +161,7 @@ AbstractButton {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
BindingCompat on visible { Binding on visible {
delayed: (MainCtx.qtVersion() < MainCtx.qtVersionCheck(5, 15, 8)) delayed: (MainCtx.qtVersion() < MainCtx.qtVersionCheck(5, 15, 8))
value: (infoColumn.height > infoColumn.implicitHeight) && (artistLabel.text.length > 0) value: (infoColumn.height > infoColumn.implicitHeight) && (artistLabel.text.length > 0)
} }

View File

@ -23,7 +23,6 @@ import QtQuick.Layouts 1.12
import QtQml.Models 2.12 import QtQml.Models 2.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///widgets/" as Widgets import "qrc:///widgets/" as Widgets
import "qrc:///style/" import "qrc:///style/"

View File

@ -22,7 +22,6 @@ import QtQuick.Layouts 1.12
import QtQml.Models 2.12 import QtQml.Models 2.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///widgets/" as Widgets import "qrc:///widgets/" as Widgets
import "qrc:///util" as Util import "qrc:///util" as Util
@ -256,12 +255,12 @@ T.Pane {
model: root.model model: root.model
BindingCompat on fadingEdge.enableBeginningFade { Binding on fadingEdge.enableBeginningFade {
when: (autoScroller.scrollingDirection === Util.ViewDragAutoScrollHandler.Direction.Backward) when: (autoScroller.scrollingDirection === Util.ViewDragAutoScrollHandler.Direction.Backward)
value: false value: false
} }
BindingCompat on fadingEdge.enableEndFade { Binding on fadingEdge.enableEndFade {
when: (autoScroller.scrollingDirection === Util.ViewDragAutoScrollHandler.Direction.Forward) when: (autoScroller.scrollingDirection === Util.ViewDragAutoScrollHandler.Direction.Forward)
value: false value: false
} }
@ -307,7 +306,7 @@ T.Pane {
footer: Item { footer: Item {
implicitWidth: parent.width implicitWidth: parent.width
BindingCompat on implicitHeight { Binding on implicitHeight {
delayed: true delayed: true
value: Math.max(VLCStyle.icon_normal, listView.height - y) value: Math.max(VLCStyle.icon_normal, listView.height - y)
} }
@ -472,7 +471,7 @@ T.Pane {
opacity: (listView.activeFocus) ? 1.0 : 0.4 opacity: (listView.activeFocus) ? 1.0 : 0.4
BindingCompat on visible { Binding on visible {
delayed: true delayed: true
value: (listView.model.count === 0 && !listView.footerItem.firstItemIndicatorVisible) value: (listView.model.count === 0 && !listView.footerItem.firstItemIndicatorVisible)
} }

View File

@ -21,7 +21,6 @@ pragma Singleton
import QtQuick 2.12 import QtQuick 2.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
Item { Item {
id: root id: root
@ -37,7 +36,7 @@ Item {
} }
} }
BindingCompat { Binding {
when: root.enabled when: root.enabled
target: MainCtx target: MainCtx
property: "acrylicActive" property: "acrylicActive"

View File

@ -1,25 +0,0 @@
/*****************************************************************************
* Copyright (C) 2022 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ( at your option ) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
import QtQuick 2.14
import QtQml 2.14
Binding {
// Binding Revision 14
restoreMode: Binding.RestoreBindingOrValue
}

View File

@ -1,25 +0,0 @@
/*****************************************************************************
* Copyright (C) 2022 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ( at your option ) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
import QtQuick 2.8
import QtQml 2.8
Binding {
// Binding Revision 8
// Only restores previous value if it was a binding
}

View File

@ -1,24 +0,0 @@
/*****************************************************************************
* Copyright (C) 2023 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ( at your option ) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
import QtQuick 2.12
ListView {
}

View File

@ -1,24 +0,0 @@
/*****************************************************************************
* Copyright (C) 2023 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ( at your option ) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
import QtQuick 2.15
ListView {
}

View File

@ -73,12 +73,8 @@
<file alias="ModelSortSettingHandler.qml">util/qml/ModelSortSettingHandler.qml</file> <file alias="ModelSortSettingHandler.qml">util/qml/ModelSortSettingHandler.qml</file>
<file alias="FlickableScrollHandler.qml">util/qml/FlickableScrollHandler.qml</file> <file alias="FlickableScrollHandler.qml">util/qml/FlickableScrollHandler.qml</file>
<file alias="ViewDragAutoScrollHandler.qml">util/qml/ViewDragAutoScrollHandler.qml</file> <file alias="ViewDragAutoScrollHandler.qml">util/qml/ViewDragAutoScrollHandler.qml</file>
<file alias="BindingRev8.qml">util/qml/BindingRev8.qml</file>
<file alias="BindingRev14.qml">util/qml/BindingRev14.qml</file>
<file alias="NativeMenu.qml">util/qml/NativeMenu.qml</file> <file alias="NativeMenu.qml">util/qml/NativeMenu.qml</file>
<file alias="MLContextMenu.qml">util/qml/MLContextMenu.qml</file> <file alias="MLContextMenu.qml">util/qml/MLContextMenu.qml</file>
<file alias="ListViewRev15.qml">util/qml/ListViewRev15.qml</file>
<file alias="ListViewRev11.qml">util/qml/ListViewRev11.qml</file>
<file alias="FSM.qml">util/qml/FSM.qml</file> <file alias="FSM.qml">util/qml/FSM.qml</file>
<file alias="FSMState.qml">util/qml/FSMState.qml</file> <file alias="FSMState.qml">util/qml/FSMState.qml</file>
<file alias="FadeControllerStateGroup.qml">util/qml/FadeControllerStateGroup.qml</file> <file alias="FadeControllerStateGroup.qml">util/qml/FadeControllerStateGroup.qml</file>

View File

@ -17,8 +17,6 @@
*****************************************************************************/ *****************************************************************************/
import QtQuick 2.12 import QtQuick 2.12
import org.videolan.compat 0.1
import "qrc:///style/" import "qrc:///style/"
import "qrc:///util/Helpers.js" as Helpers import "qrc:///util/Helpers.js" as Helpers

View File

@ -17,8 +17,6 @@
*****************************************************************************/ *****************************************************************************/
import QtQuick 2.12 import QtQuick 2.12
import org.videolan.compat 0.1
import "qrc:///style/" import "qrc:///style/"
import "qrc:///util/Helpers.js" as Helpers import "qrc:///util/Helpers.js" as Helpers
@ -109,12 +107,12 @@ FadingEdge {
(!lastVisibleItem.activeFocus && (!lastVisibleItem.activeFocus &&
!Helpers.get(lastVisibleItem, "hovered", true))) !Helpers.get(lastVisibleItem, "hovered", true)))
BindingCompat on enableBeginningFade { Binding on enableBeginningFade {
when: !!listView.headerItem && (listView.headerPositioning !== ListView.InlineHeader) when: !!listView.headerItem && (listView.headerPositioning !== ListView.InlineHeader)
value: false value: false
} }
BindingCompat on enableEndFade { Binding on enableEndFade {
when: !!listView.footerItem && (listView.footerPositioning !== ListView.InlineFooter) when: !!listView.footerItem && (listView.footerPositioning !== ListView.InlineFooter)
value: false value: false
} }

View File

@ -22,7 +22,6 @@ import QtQuick.Layouts 1.12
import QtQml.Models 2.12 import QtQml.Models 2.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
import "qrc:///widgets/" as Widgets import "qrc:///widgets/" as Widgets
import "qrc:///util/Helpers.js" as Helpers import "qrc:///util/Helpers.js" as Helpers

View File

@ -21,7 +21,6 @@
import QtQuick 2.12 import QtQuick 2.12
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import org.videolan.compat 0.1
Image { Image {
id: root id: root
@ -35,7 +34,7 @@ Image {
readonly property bool _smooth: true readonly property bool _smooth: true
smooth: _smooth smooth: _smooth
BindingCompat on smooth { Binding on smooth {
when: root.disableSmoothWhenIntegerUpscaling && when: root.disableSmoothWhenIntegerUpscaling &&
!((root.paintedWidth % root.implicitWidth) || (root.paintedHeight % root.implicitHeight)) !((root.paintedWidth % root.implicitWidth) || (root.paintedHeight % root.implicitHeight))
value: false value: false

View File

@ -20,7 +20,6 @@ import QtQuick 2.12
import QtQuick.Templates 2.12 as T import QtQuick.Templates 2.12 as T
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import org.videolan.compat 0.1
import org.videolan.vlc 0.1 import org.videolan.vlc 0.1
import "qrc:///widgets/" as Widgets import "qrc:///widgets/" as Widgets