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 diff --git a/plugins/systemvolume/systemvolumeplugin-pulse.cpp b/plugins/systemvolume/systemvolumeplugin-pulse.cpp index da4fb0a62..5c20638ed 100644 --- a/plugins/systemvolume/systemvolumeplugin-pulse.cpp +++ b/plugins/systemvolume/systemvolumeplugin-pulse.cpp @@ -55,12 +55,15 @@ bool SystemvolumePlugin::receivePacket(const NetworkPacket& np) QString name = np.get(QStringLiteral("name")); - if (sinksMap.contains(name)) { + PulseAudioQt::Sink *sink = sinksMap.value(name); + if (sink) { if (np.has(QStringLiteral("volume"))) { - sinksMap[name]->setVolume(np.get(QStringLiteral("volume"))); + int volume = np.get(QStringLiteral("volume")); + sink->setVolume(volume); + sink->setMuted(false); } if (np.has(QStringLiteral("muted"))) { - sinksMap[name]->setMuted(np.get(QStringLiteral("muted"))); + sink->setMuted(np.get(QStringLiteral("muted"))); } } }