Fix findthisdevice sound URL
This commit is contained in:
parent
dc9da25fc9
commit
4df8dfc882
2 changed files with 3 additions and 3 deletions
|
@ -47,7 +47,7 @@ bool FindThisDevicePlugin::receivePacket(const NetworkPacket& np)
|
||||||
{
|
{
|
||||||
Q_UNUSED(np);
|
Q_UNUSED(np);
|
||||||
const QString soundFile = config()->get<QString>(QStringLiteral("ringtone"), defaultSound());
|
const QString soundFile = config()->get<QString>(QStringLiteral("ringtone"), defaultSound());
|
||||||
const QUrl soundURL = QUrl(soundFile);
|
const QUrl soundURL = QUrl::fromLocalFile(soundFile);
|
||||||
if (soundURL.isEmpty()) {
|
if (soundURL.isEmpty()) {
|
||||||
qCWarning(KDECONNECT_PLUGIN_FINDTHISDEVICE) << "Not playing sound, no valid ring tone specified.";
|
qCWarning(KDECONNECT_PLUGIN_FINDTHISDEVICE) << "Not playing sound, no valid ring tone specified.";
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -81,7 +81,7 @@ inline QString defaultSound()
|
||||||
soundURL = QUrl::fromUserInput(QStringLiteral("Oxygen-Im-Phone-Ring.ogg"),
|
soundURL = QUrl::fromUserInput(QStringLiteral("Oxygen-Im-Phone-Ring.ogg"),
|
||||||
dirPath,
|
dirPath,
|
||||||
QUrl::AssumeLocalFile);
|
QUrl::AssumeLocalFile);
|
||||||
if ((soundURL.isLocalFile() && QFile::exists(soundURL.toLocalFile())) || soundURL.isValid()) {
|
if ((soundURL.isLocalFile() && soundURL.isValid() && QFile::exists(soundURL.toLocalFile()))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ inline QString defaultSound()
|
||||||
if (soundURL.isEmpty()) {
|
if (soundURL.isEmpty()) {
|
||||||
qCWarning(KDECONNECT_PLUGIN_FINDTHISDEVICE) << "Could not find default ring tone.";
|
qCWarning(KDECONNECT_PLUGIN_FINDTHISDEVICE) << "Could not find default ring tone.";
|
||||||
}
|
}
|
||||||
return soundURL.toString();
|
return soundURL.toLocalFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //FINDTHISDEVICEPLUGIN_H
|
#endif //FINDTHISDEVICEPLUGIN_H
|
||||||
|
|
Loading…
Reference in a new issue