UI: Fix double confirmation dialog while discarding source change

QDialog::closeEvent() already calls the reject() function, the override
of the former function was actually allowing a first confirmation dialog
which once discarded gets re-openned by QDialog::closeEvent().

Removing most of the closeEvent() override code is enough to fix the issue
since reject() will be called showing the confirmation dialog.
This commit is contained in:
tytan652 2024-04-11 10:57:24 +02:00 • committed by Lain
commit 3b87098508

View file

@ -476,18 +476,9 @@ void OBSBasicProperties::reject()
void OBSBasicProperties::closeEvent(QCloseEvent *event)
{
if (!acceptClicked && (CheckSettings() != 0)) {
if (!ConfirmQuit()) {
event->ignore();
return;
}
}
QDialog::closeEvent(event);
if (!event->isAccepted())
return;
Cleanup();
if (event->isAccepted())
Cleanup();
}
bool OBSBasicProperties::nativeEvent(const QByteArray &, void *message,