mirror of https://code.videolan.org/videolan/vlc
qt: don't allow PrefsDialog to open multiple times in DialogsProvider
allowing PrefsDialog to be opened multiple time causes massive freezing
This commit is contained in:
parent
db1abbe031
commit
35a4f48680
|
@ -62,6 +62,7 @@
|
|||
#include <QFileDialog>
|
||||
#include <QUrl>
|
||||
#include <QInputDialog>
|
||||
#include <QPointer>
|
||||
|
||||
#define I_OP_DIR_WINTITLE I_DIR_OR_FOLDER( N_("Open Directory"), \
|
||||
N_("Open Folder") )
|
||||
|
@ -248,9 +249,18 @@ const QEvent::Type DialogEvent::DialogEvent_Type =
|
|||
|
||||
void DialogsProvider::prefsDialog()
|
||||
{
|
||||
PrefsDialog *p = new PrefsDialog( nullptr, p_intf );
|
||||
p->setAttribute(Qt::WA_DeleteOnClose);
|
||||
p->toggleVisible();
|
||||
static QPointer<PrefsDialog> p;
|
||||
|
||||
if (Q_LIKELY(!p))
|
||||
{
|
||||
p = new PrefsDialog( nullptr, p_intf );
|
||||
p->setAttribute(Qt::WA_DeleteOnClose);
|
||||
p->open();
|
||||
}
|
||||
else
|
||||
{
|
||||
p->reject();
|
||||
}
|
||||
}
|
||||
|
||||
void DialogsProvider::firstRunDialog()
|
||||
|
|
Loading…
Reference in New Issue