[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kde-workspace/KDE/4.9] plasma/generic/dataengines/mpris2: MPRIS2: assume the position is 0 when sto
From: Alex Merry <kde () randomguy3 ! me ! uk>
Date: 2012-08-09 18:51:52
Message-ID: 20120809185152.9F979A6094 () git ! kde ! org
[Download RAW message or body]
Git commit 9306d64a3f5345e01a74f4f513ec8a404855f4fb by Alex Merry.
Committed on 09/08/2012 at 20:45.
Pushed by alexmerry into branch 'KDE/4.9'.
MPRIS2: assume the position is 0 when stopped
MPRIS2 does not require the Seeked() signal to be emitted when stopping
a track. It does, however, require it to be emitted if the position is
not 0 when going from Stopped to Playing (or Paused).
So we should assume the position is 0 when Stopped.
This fixes an issue I noticed with gmusicbrowser, where stopping a track
and starting it again would show the wrong time in the Now Playing
widget.
Backport of dc7074f9f503aac54007952d7429d8f1eb6a80c2
FIXED-IN: 4.9.1
M +6 -0 plasma/generic/dataengines/mpris2/playercontainer.cpp
http://commits.kde.org/kde-workspace/9306d64a3f5345e01a74f4f513ec8a404855f4fb
diff --git a/plasma/generic/dataengines/mpris2/playercontainer.cpp \
b/plasma/generic/dataengines/mpris2/playercontainer.cpp index 007b9ed..e2635cd 100644
--- a/plasma/generic/dataengines/mpris2/playercontainer.cpp
+++ b/plasma/generic/dataengines/mpris2/playercontainer.cpp
@@ -226,6 +226,12 @@ void PlayerContainer::copyProperty(const QString& propName, \
const QVariant& _val else
m_currentRate = 0.0;
}
+ if (value.toString() == QLatin1String("Stopped")) {
+ // assume the position has reset to 0, since this is really the
+ // only sensible value for a stopped track
+ setData("Position", static_cast<qint64>(0));
+ setData(POS_UPD_STRING, QDateTime::currentDateTimeUtc());
+ }
}
setData(propName, value);
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic