[SCM] qtmultimedia packaging branch, ubuntu, updated. debian/5.5.0-3-10-gf486fd4

Timo Jyrinki timo at moszumanska.debian.org
Tue Oct 6 08:12:43 UTC 2015


Gitweb-URL: http://git.debian.org/?p=pkg-kde/qt/qtmultimedia.git;a=commitdiff;h=f486fd4

The following commit has been merged in the ubuntu branch:
commit f486fd4bb563c369135cf9bfdb6a5b2be1bbf787
Author: Timo Jyrinki <timo.jyrinki at canonical.com>
Date:   Tue Oct 6 08:12:32 2015 +0000

    debian/patches/Sync-the-state-of-the-old-QMediaPlaylistControl-inst.patch
---
 debian/changelog                                   |  1 +
 ...ate-of-the-old-QMediaPlaylistControl-inst.patch | 85 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 87 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index cd397e0..660a1cf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ qtmultimedia-opensource-src (5.5.0-3ubuntu1) UNRELEASED; urgency=medium
     debian/patches/Added-new-playlist-QML-type.patch:
     - The Audio role API and Playlist type patches were upstreamed for 
       Qt 5.6, use backported versions of those.
+  * debian/patches/Sync-the-state-of-the-old-QMediaPlaylistControl-inst.patch
 
  -- Timo Jyrinki <timo-jyrinki at ubuntu.com>  Fri, 17 Jul 2015 13:14:07 +0000
 
diff --git a/debian/patches/Sync-the-state-of-the-old-QMediaPlaylistControl-inst.patch b/debian/patches/Sync-the-state-of-the-old-QMediaPlaylistControl-inst.patch
new file mode 100644
index 0000000..8f3a556
--- /dev/null
+++ b/debian/patches/Sync-the-state-of-the-old-QMediaPlaylistControl-inst.patch
@@ -0,0 +1,85 @@
+From 4cbd67c22a1d6aa339fc29bc5f7a9c0a40cc0b9e Mon Sep 17 00:00:00 2001
+From: Jim Hodapp <jim.hodapp at canonical.com>
+Date: Mon, 5 Oct 2015 14:56:29 -0400
+Subject: [PATCH] Sync the state of the old QMediaPlaylistControl instance with
+ the new QMediaPlaylistControl instance when not using the default instance.
+
+Change-Id: I9d50cb445c86d96f70b366a0017715df2d2b4a29
+---
+ src/multimedia/playback/qmediaplaylist.cpp | 32 ++++++++++++++++++++++++++++++
+ src/multimedia/playback/qmediaplaylist.h   |  2 ++
+ 2 files changed, 34 insertions(+)
+
+diff --git a/src/multimedia/playback/qmediaplaylist.cpp b/src/multimedia/playback/qmediaplaylist.cpp
+index 0681359..7db805d 100644
+--- a/src/multimedia/playback/qmediaplaylist.cpp
++++ b/src/multimedia/playback/qmediaplaylist.cpp
+@@ -145,6 +145,35 @@ QMediaObject *QMediaPlaylist::mediaObject() const
+ }
+ 
+ /*!
++ * \internal
++ * Copy playlist items, sync playback mode and sync current index between old control and new control
++*/
++void QMediaPlaylist::syncControls(QMediaPlaylistControl *oldControl, QMediaPlaylistControl *newControl)
++{
++    if (!oldControl || !newControl) {
++        qWarning() << "Failed to sync control states since oldControl or newControl is NULL";
++        return;
++    }
++
++    newControl->setPlaybackMode(oldControl->playbackMode());
++    emit newControl->playbackModeChanged(oldControl->playbackMode());
++    newControl->setCurrentIndex(oldControl->currentIndex());
++    emit newControl->currentIndexChanged(oldControl->currentIndex());
++
++    const QMediaPlaylistProvider *oldPlaylist = oldControl->playlistProvider();
++    QMediaPlaylistProvider *newPlaylist = newControl->playlistProvider();
++
++    if (oldPlaylist && newPlaylist) {
++        const int oldPlaylistSize = oldPlaylist->mediaCount();
++        for (int i=0; i<oldPlaylistSize; i++) {
++            newPlaylist->addMedia(oldPlaylist->media(i));
++        }
++    } else {
++        qWarning() << "Failed to sync control playlists since oldPlaylist or newPlaylist is NULL";
++    }
++}
++
++/*!
+   \internal
+   If  mediaObject is null or doesn't have an intrinsic playlist,
+   internal local memory playlist source will be created.
+@@ -170,6 +199,9 @@ bool QMediaPlaylist::setMediaObject(QMediaObject *mediaObject)
+     if (d->control != newControl) {
+         int oldSize = 0;
+         if (d->control) {
++            // Copy playlist items, sync playback mode and sync current index between old control and new control
++            syncControls(d->control, newControl);
++
+             QMediaPlaylistProvider *playlist = d->control->playlistProvider();
+             oldSize = playlist->mediaCount();
+             disconnect(playlist, SIGNAL(loadFailed(QMediaPlaylist::Error,QString)),
+diff --git a/src/multimedia/playback/qmediaplaylist.h b/src/multimedia/playback/qmediaplaylist.h
+index 1388ac1..b21a7f1 100644
+--- a/src/multimedia/playback/qmediaplaylist.h
++++ b/src/multimedia/playback/qmediaplaylist.h
+@@ -45,6 +45,7 @@
+ QT_BEGIN_NAMESPACE
+ 
+ 
++class QMediaPlaylistControl;
+ class QMediaPlaylistProvider;
+ 
+ class QMediaPlaylistPrivate;
+@@ -122,6 +123,7 @@ Q_SIGNALS:
+     void loadFailed();
+ 
+ protected:
++    void syncControls(QMediaPlaylistControl *oldControl, QMediaPlaylistControl *newControl);
+     bool setMediaObject(QMediaObject *object);
+     QMediaPlaylistPrivate *d_ptr;
+ 
+-- 
+2.5.0
+
diff --git a/debian/patches/series b/debian/patches/series
index 2afb44d..2f593a7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ skip_failing_tests.patch
 qgstreamercapturesession_avoid_race_eos.patch
 Added-new-playlist-QML-type.patch
 Add-audio-role-API-to-QMediaPlayer.patch
+Sync-the-state-of-the-old-QMediaPlaylistControl-inst.patch

-- 
qtmultimedia packaging



More information about the pkg-kde-commits mailing list