Commit 370e5776 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Reuse QWidgets dialog

Otherwise the engine would make a new network request, this is quite
wasteful and lets the user wait a moment.
Also this appears to fixes the crash, you can try this out by quickly
opening and closing the dialog.

Additionally this makes it consistent with the QtQuick one.

From the stacktrace I got this seems to fix BUG 429302.

BUG: 416328
BUG: 429302
FIXED-IN: 5.77
parent fd0ea42f
......@@ -21,6 +21,7 @@ class ButtonPrivate
{
public:
QString configFile;
QPointer<DownloadDialog> dialog;
};
Button::Button(const QString &text,
......@@ -80,13 +81,14 @@ void Button::showDialog()
}
Q_EMIT aboutToShowDialog();
QPointer<DownloadDialog> dialog = new DownloadDialog(d->configFile, this);
dialog->exec();
if (dialog)
Q_EMIT dialogFinished(dialog->changedEntries());
if (!d->dialog) {
d->dialog = new DownloadDialog(d->configFile, this);
}
d->dialog->exec();
delete dialog;
if (d->dialog) {
Q_EMIT dialogFinished(d->dialog->changedEntries());
}
}
}
......
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