UI: Fix changed state of audio settings

When changing audio channels, sample rate, or audio buffering settings
multiple times by hitting `Apply` button, the internal `changed` state
got corrupted. To avoid this, set the changed state when changed
something, but do not clear the changed state.
This commit is contained in:
Norihiro Kamae 2023-06-18 01:47:43 +09:00 committed by Lain
parent 35463cb464
commit 846cdafbed

View file

@ -4643,17 +4643,15 @@ void OBSBasicSettings::AudioChangedRestart()
if (currentChannelIndex != channelIndex ||
currentSampleRateIndex != sampleRateIndex ||
currentLLAudioBufVal != llBufferingEnabled) {
audioChanged = true;
ui->audioMsg->setText(
QTStr("Basic.Settings.ProgramRestart"));
sender()->setProperty("changed", QVariant(true));
EnableApplyButton(true);
} else {
audioChanged = false;
ui->audioMsg->setText("");
sender()->setProperty("changed", QVariant(false));
EnableApplyButton(false);
}
audioChanged = true;
sender()->setProperty("changed", QVariant(true));
EnableApplyButton(true);
}
}