Commit 1a95e7c7 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[MPris Engine] Don't construct QDBusObjectPath in Metadata update

Creating one from an empty string prints a warning and here we don't actually need
a fully-fledged QDBusObjectPath, we can just compare strings.

BUG: 383557

Differential Revision: https://phabricator.kde.org/D7538
parent a243eb87
......@@ -231,8 +231,8 @@ void PlayerContainer::copyProperty(const QString& propName, const QVariant& _val
} else if (propName == QLatin1String("Metadata")) {
if (updType == UpdatedSignal) {
QDBusObjectPath oldTrackId(data().value(QStringLiteral("Metadata")).toMap().value(QStringLiteral("mpris:trackid")).toString());
QDBusObjectPath newTrackId(value.toMap().value(QStringLiteral("mpris:trackid")).toString());
const QString oldTrackId = data().value(QStringLiteral("Metadata")).toMap().value(QStringLiteral("mpris:trackid")).toString();
const QString newTrackId = value.toMap().value(QStringLiteral("mpris:trackid")).toString();
if (oldTrackId != newTrackId) {
setData(QStringLiteral("Position"), static_cast<qlonglong>(0));
setData(POS_UPD_STRING, QDateTime::currentDateTimeUtc());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment