Fix unable to control add torrent dialogs when opened simultaneously

This commit is contained in:
Chocobo1 2019-06-05 12:25:45 +08:00
parent c01aed8d90
commit ec13d195f8
No known key found for this signature in database
GPG key ID: 210D9C873253A68C

View file

@ -95,6 +95,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
// TODO: set dialog file properties using m_torrentParams.filePriorities
m_ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
m_ui->lblMetaLoading->setVisible(false);
m_ui->progMetaLoading->setVisible(false);
@ -244,11 +245,7 @@ void AddNewTorrentDialog::show(QString source, const BitTorrent::AddTorrentParam
ok = dlg->loadTorrent(source);
if (ok)
#ifdef Q_OS_MAC
dlg->exec();
#else
dlg->open();
#endif
dlg->QDialog::show();
else
delete dlg;
}