diff --git a/plugins/findthisdevice/findthisdeviceplugin.cpp b/plugins/findthisdevice/findthisdeviceplugin.cpp index eeddb4ec2..5d0df2ae0 100644 --- a/plugins/findthisdevice/findthisdeviceplugin.cpp +++ b/plugins/findthisdevice/findthisdeviceplugin.cpp @@ -47,7 +47,7 @@ bool FindThisDevicePlugin::receivePacket(const NetworkPacket& np) { Q_UNUSED(np); const QString soundFile = config()->get(QStringLiteral("ringtone"), defaultSound()); - const QUrl soundURL = QUrl(soundFile); + const QUrl soundURL = QUrl::fromLocalFile(soundFile); if (soundURL.isEmpty()) { qCWarning(KDECONNECT_PLUGIN_FINDTHISDEVICE) << "Not playing sound, no valid ring tone specified."; return true; diff --git a/plugins/findthisdevice/findthisdeviceplugin.h b/plugins/findthisdevice/findthisdeviceplugin.h index 072715cf9..8b957c259 100644 --- a/plugins/findthisdevice/findthisdeviceplugin.h +++ b/plugins/findthisdevice/findthisdeviceplugin.h @@ -81,7 +81,7 @@ inline QString defaultSound() soundURL = QUrl::fromUserInput(QStringLiteral("Oxygen-Im-Phone-Ring.ogg"), dirPath, QUrl::AssumeLocalFile); - if ((soundURL.isLocalFile() && QFile::exists(soundURL.toLocalFile())) || soundURL.isValid()) { + if ((soundURL.isLocalFile() && soundURL.isValid() && QFile::exists(soundURL.toLocalFile()))) { break; } } @@ -89,7 +89,7 @@ inline QString defaultSound() if (soundURL.isEmpty()) { qCWarning(KDECONNECT_PLUGIN_FINDTHISDEVICE) << "Could not find default ring tone."; } - return soundURL.toString(); + return soundURL.toLocalFile(); } #endif //FINDTHISDEVICEPLUGIN_H