mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Fix non-working UniqueConnection in gtk file dialog
This commit is contained in:
parent
6b68d001ae
commit
fe5de8f009
1 changed files with 5 additions and 2 deletions
|
@ -147,6 +147,8 @@ private:
|
|||
rpl::event_stream<> _accept;
|
||||
rpl::event_stream<> _reject;
|
||||
|
||||
bool _destroyedConnected = false;
|
||||
|
||||
};
|
||||
|
||||
class GtkFileDialog : public QDialog {
|
||||
|
@ -261,8 +263,9 @@ void QGtkDialog::exec() {
|
|||
}
|
||||
|
||||
void QGtkDialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) {
|
||||
connect(parent, &QWindow::destroyed, this, [=] { onParentWindowDestroyed(); },
|
||||
Qt::UniqueConnection);
|
||||
if (!std::exchange(_destroyedConnected, true)) {
|
||||
connect(parent, &QWindow::destroyed, this, [=] { onParentWindowDestroyed(); });
|
||||
}
|
||||
setParent(parent);
|
||||
setFlags(flags);
|
||||
setModality(modality);
|
||||
|
|
Loading…
Add table
Reference in a new issue