mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +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<> _accept;
|
||||||
rpl::event_stream<> _reject;
|
rpl::event_stream<> _reject;
|
||||||
|
|
||||||
|
bool _destroyedConnected = false;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class GtkFileDialog : public QDialog {
|
class GtkFileDialog : public QDialog {
|
||||||
|
@ -261,8 +263,9 @@ void QGtkDialog::exec() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGtkDialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) {
|
void QGtkDialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) {
|
||||||
connect(parent, &QWindow::destroyed, this, [=] { onParentWindowDestroyed(); },
|
if (!std::exchange(_destroyedConnected, true)) {
|
||||||
Qt::UniqueConnection);
|
connect(parent, &QWindow::destroyed, this, [=] { onParentWindowDestroyed(); });
|
||||||
|
}
|
||||||
setParent(parent);
|
setParent(parent);
|
||||||
setFlags(flags);
|
setFlags(flags);
|
||||||
setModality(modality);
|
setModality(modality);
|
||||||
|
|
Loading…
Add table
Reference in a new issue