mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-05 07:02:31 -06:00
Restore BitTorrent session asynchronously
Reduce the total startup time of the application and maintain sufficient responsiveness of the UI during startup due to the following: 1. Load resume data from disk asynchronously in separate thread; 2. Split handling of loaded resume data in chunks; 3. Reduce the number of emitting signals. PR #16840.
This commit is contained in:
committed by
GitHub
parent
ec1d2cba40
commit
be7cfb78de
@@ -208,7 +208,7 @@ void SearchJobWidget::cancelSearch()
|
||||
|
||||
void SearchJobWidget::downloadTorrents(const AddTorrentOption option)
|
||||
{
|
||||
const QModelIndexList rows {m_ui->resultsBrowser->selectionModel()->selectedRows()};
|
||||
const QModelIndexList rows = m_ui->resultsBrowser->selectionModel()->selectedRows();
|
||||
for (const QModelIndex &rowIndex : rows)
|
||||
downloadTorrent(rowIndex, option);
|
||||
}
|
||||
@@ -390,10 +390,10 @@ void SearchJobWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||
auto *menu = new QMenu(this);
|
||||
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"kt-set-max-download-speed"_qs), tr("Open download window")
|
||||
, this, [this]() { downloadTorrents(AddTorrentOption::ShowDialog); });
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"downloading"_qs), tr("Download")
|
||||
, this, [this]() { downloadTorrents(AddTorrentOption::SkipDialog); });
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"kt-set-max-download-speed"_qs)
|
||||
, tr("Open download window"), this, [this]() { downloadTorrents(AddTorrentOption::ShowDialog); });
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"downloading"_qs)
|
||||
, tr("Download"), this, [this]() { downloadTorrents(AddTorrentOption::SkipDialog); });
|
||||
menu->addSeparator();
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"application-x-mswinurl"_qs), tr("Open description page")
|
||||
, this, &SearchJobWidget::openTorrentPages);
|
||||
|
||||
Reference in New Issue
Block a user