From 92f0e467ae616f0db7216723cfb294a243c3bfff Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Thu, 25 May 2023 16:20:37 +0200 Subject: [PATCH] Compare strings like regular human beings --- plugins/systemvolume/systemvolumeplugin-win.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/systemvolume/systemvolumeplugin-win.cpp b/plugins/systemvolume/systemvolumeplugin-win.cpp index f8b7b43eb..5c310fc09 100644 --- a/plugins/systemvolume/systemvolumeplugin-win.cpp +++ b/plugins/systemvolume/systemvolumeplugin-win.cpp @@ -72,6 +72,7 @@ public: HRESULT STDMETHODCALLTYPE OnNotify(PAUDIO_VOLUME_NOTIFICATION_DATA pNotify) override { + qWarning("OnNotify"); NetworkPacket np(PACKET_TYPE_SYSTEMVOLUME); np.set(QStringLiteral("volume"), (int)(pNotify->fMasterVolume * 100)); np.set(QStringLiteral("muted"), pNotify->bMuted); @@ -433,8 +434,7 @@ bool SystemvolumePlugin::receivePacket(const NetworkPacket &np) // get current sink's device ID QString qDefaultId = QString::fromWCharArray(defaultId); QString currentDeviceId = idToNameMap.key(name); - - if ((bool)qDefaultId.compare(currentDeviceId)) { + if (qDefaultId != currentDeviceId) { setDefaultAudioPlaybackDevice(name, np.get(QStringLiteral("enabled"))); } }