[vlc-devel] [PATCH 10/14] qml: only switch to the MaxiPlayer when the number of video tracks actually changes

Pierre Lamot pierre at videolabs.io
Thu Oct 22 15:14:22 CEST 2020


---
 modules/gui/qt/maininterface/qml/MainDisplay.qml | 6 +++---
 modules/gui/qt/player/input_models.cpp           | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/maininterface/qml/MainDisplay.qml b/modules/gui/qt/maininterface/qml/MainDisplay.qml
index bf5937d555..d0b81b6878 100644
--- a/modules/gui/qt/maininterface/qml/MainDisplay.qml
+++ b/modules/gui/qt/maininterface/qml/MainDisplay.qml
@@ -389,9 +389,9 @@ Widgets.NavigableFocusScope {
             }
 
             Connections {
-                target: player.videoTracks
-                onDataChanged: {
-                    if (player.videoTracks.rowCount() > 0
+                target: player.videoTracks.count
+                onCountChanged: {
+                    if (player.videoTracks.count > 0
                             && player.playingState === PlayerController.PLAYING_STATE_PLAYING) {
                         g_mainDisplay.showPlayer()
                     }
diff --git a/modules/gui/qt/player/input_models.cpp b/modules/gui/qt/player/input_models.cpp
index 3164ad845c..76ee995deb 100644
--- a/modules/gui/qt/player/input_models.cpp
+++ b/modules/gui/qt/player/input_models.cpp
@@ -144,6 +144,7 @@ void TrackListModel::clear()
     beginRemoveRows({}, 0, m_data.size() - 1);
     m_data.clear();
     endRemoveRows();
+    emit countChanged();
 }
 
 QHash<int, QByteArray> TrackListModel::roleNames() const
-- 
2.25.1



More information about the vlc-devel mailing list