Merge branch 'release/20.04'
This commit is contained in:
commit
872d5c6464
3 changed files with 9 additions and 6 deletions
|
@ -47,7 +47,7 @@ bool FindThisDevicePlugin::receivePacket(const NetworkPacket& np)
|
|||
{
|
||||
Q_UNUSED(np);
|
||||
const QString soundFile = config()->get<QString>(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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -55,12 +55,15 @@ bool SystemvolumePlugin::receivePacket(const NetworkPacket& np)
|
|||
|
||||
QString name = np.get<QString>(QStringLiteral("name"));
|
||||
|
||||
if (sinksMap.contains(name)) {
|
||||
PulseAudioQt::Sink *sink = sinksMap.value(name);
|
||||
if (sink) {
|
||||
if (np.has(QStringLiteral("volume"))) {
|
||||
sinksMap[name]->setVolume(np.get<int>(QStringLiteral("volume")));
|
||||
int volume = np.get<int>(QStringLiteral("volume"));
|
||||
sink->setVolume(volume);
|
||||
sink->setMuted(false);
|
||||
}
|
||||
if (np.has(QStringLiteral("muted"))) {
|
||||
sinksMap[name]->setMuted(np.get<bool>(QStringLiteral("muted")));
|
||||
sink->setMuted(np.get<bool>(QStringLiteral("muted")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue