mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-08-26 13:42:37 +00:00
Merge pull request #17498 from glassez/fix-windows-race
This commit is contained in:
commit
5c96f16e3d
@ -754,10 +754,30 @@ try
|
|||||||
});
|
});
|
||||||
|
|
||||||
disconnect(m_desktopIntegration, &DesktopIntegration::activationRequested, this, &Application::createStartupProgressDialog);
|
disconnect(m_desktopIntegration, &DesktopIntegration::activationRequested, this, &Application::createStartupProgressDialog);
|
||||||
delete m_desktopIntegration->menu();
|
// we must not delete menu while it is used by DesktopIntegration
|
||||||
|
auto *oldMenu = m_desktopIntegration->menu();
|
||||||
const MainWindow::State windowState = (!m_startupProgressDialog || (m_startupProgressDialog->windowState() & Qt::WindowMinimized))
|
const MainWindow::State windowState = (!m_startupProgressDialog || (m_startupProgressDialog->windowState() & Qt::WindowMinimized))
|
||||||
? MainWindow::Minimized : MainWindow::Normal;
|
? MainWindow::Minimized : MainWindow::Normal;
|
||||||
m_window = new MainWindow(this, windowState);
|
m_window = new MainWindow(this, windowState);
|
||||||
|
delete oldMenu;
|
||||||
|
delete m_startupProgressDialog;
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
auto *pref = Preferences::instance();
|
||||||
|
if (!pref->neverCheckFileAssoc() && (!Preferences::isTorrentFileAssocSet() || !Preferences::isMagnetLinkAssocSet()))
|
||||||
|
{
|
||||||
|
if (QMessageBox::question(m_window, tr("Torrent file association")
|
||||||
|
, tr("qBittorrent is not the default application for opening torrent files or Magnet links.\nDo you want to make qBittorrent the default application for these?")
|
||||||
|
, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes)
|
||||||
|
{
|
||||||
|
pref->setTorrentFileAssoc(true);
|
||||||
|
pref->setMagnetLinkAssoc(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pref->setNeverCheckFileAssoc();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // Q_OS_WIN
|
||||||
#endif // DISABLE_GUI
|
#endif // DISABLE_GUI
|
||||||
|
|
||||||
#ifndef DISABLE_WEBUI
|
#ifndef DISABLE_WEBUI
|
||||||
@ -838,7 +858,6 @@ void Application::createStartupProgressDialog()
|
|||||||
});
|
});
|
||||||
|
|
||||||
connect(BitTorrent::Session::instance(), &BitTorrent::Session::startupProgressUpdated, m_startupProgressDialog, &QProgressDialog::setValue);
|
connect(BitTorrent::Session::instance(), &BitTorrent::Session::startupProgressUpdated, m_startupProgressDialog, &QProgressDialog::setValue);
|
||||||
connect(BitTorrent::Session::instance(), &BitTorrent::Session::restored, m_startupProgressDialog, &QObject::deleteLater);
|
|
||||||
|
|
||||||
connect(m_desktopIntegration, &DesktopIntegration::activationRequested, m_startupProgressDialog, [this]()
|
connect(m_desktopIntegration, &DesktopIntegration::activationRequested, m_startupProgressDialog, [this]()
|
||||||
{
|
{
|
||||||
|
@ -460,22 +460,6 @@ MainWindow::MainWindow(IGUIApplication *app, const State initialState)
|
|||||||
connect(pref, &Preferences::changed, this, &MainWindow::optionsSaved);
|
connect(pref, &Preferences::changed, this, &MainWindow::optionsSaved);
|
||||||
|
|
||||||
qDebug("GUI Built");
|
qDebug("GUI Built");
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
if (!pref->neverCheckFileAssoc() && (!Preferences::isTorrentFileAssocSet() || !Preferences::isMagnetLinkAssocSet()))
|
|
||||||
{
|
|
||||||
if (QMessageBox::question(this, tr("Torrent file association"),
|
|
||||||
tr("qBittorrent is not the default application for opening torrent files or Magnet links.\nDo you want to make qBittorrent the default application for these?"),
|
|
||||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes)
|
|
||||||
{
|
|
||||||
Preferences::setTorrentFileAssoc(true);
|
|
||||||
Preferences::setMagnetLinkAssoc(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pref->setNeverCheckFileAssoc();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user