summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@cs.ox.ac.uk>2011-11-15 14:32:42 +0000
committerAlex Merry <alex.merry@cs.ox.ac.uk>2011-11-15 14:32:42 +0000
commitea6c43dd58466432641331e13ff013d605d2d2af (patch)
tree4d9b7ed9772bd332b36cf9db4843e64ee4274d04
parent9375addec32e7e07b82bb1cd56316ae114eb34dc (diff)
CanControl should not change
-rw-r--r--mpris2/playerinterfacetest.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/mpris2/playerinterfacetest.cpp b/mpris2/playerinterfacetest.cpp
index 00658fc..08469de 100644
--- a/mpris2/playerinterfacetest.cpp
+++ b/mpris2/playerinterfacetest.cpp
@@ -86,7 +86,14 @@ void PlayerInterfaceTest::checkProps(const QVariantMap& oldProps)
checkPosition(oldProps);
checkPredictedPosition();
- checkPropValid("CanControl", QVariant::Bool, oldProps);
+ if (checkPropValid("CanControl", QVariant::Bool) && oldProps.contains("CanControl")) {
+ bool newCanControl = props.value("CanControl").toBool();
+ bool oldCanControl = oldProps.value("CanControl").toBool();
+ if (newCanControl != oldCanControl) {
+ emit interfaceError(Property, "CanControl",
+ "CanControl is an inherent property of the implementation, and should not change");
+ }
+ }
checkControlProp("CanGoNext", oldProps);
checkControlProp("CanGoPrevious", oldProps);
checkControlProp("CanPlay", oldProps);
@@ -531,7 +538,7 @@ void PlayerInterfaceTest::_m_seeked(qint64 position, const QDBusMessage& message
qint64 PlayerInterfaceTest::predictedPosition()
{
- qint64 elapsed = (qint64)m_posLastUpdated.elapsed() * 1000;
+ qint64 elapsed = (qint64)m_posLastUpdated.elapsed() * 1000L;
return m_pos + (m_currentRate * elapsed);
}