Commit 2509b6bb authored by David Rosca's avatar David Rosca

Don't call setDefaultSink/Source when already default

Checked state changes are not correctly handled in default device
QtQuickControls checkbox in KCM (changes are applied also for non-user
initiated, eg. on component complete).
This triggers setting the default device when opening KCM which moves all
streams to that device, and it breaks any previous manual configuration
(moving streams to different devices).

Make sure we call setDefaultSink/Source only when the default device
is actually different.

BUG: 380414
FIXED-IN: 5.10.1

Differential Revision: https://phabricator.kde.org/D6055
parent 1fea4bbf
......@@ -69,7 +69,7 @@ bool Sink::isDefault() const
void Sink::setDefault(bool enable)
{
if (enable) {
if (!isDefault() && enable) {
context()->server()->setDefaultSink(this);
}
}
......
......@@ -69,7 +69,7 @@ bool Source::isDefault() const
void Source::setDefault(bool enable)
{
if (enable) {
if (!isDefault() && enable) {
context()->server()->setDefaultSource(this);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment