mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
Avoid allocating a new menu/action manually
This commit is contained in:
parent
04e7b3f6d2
commit
412e326cf2
4 changed files with 10 additions and 25 deletions
|
@ -600,10 +600,8 @@ void PropertiesWidget::displayFilesListMenu(const QPoint &)
|
|||
menu->addSeparator();
|
||||
}
|
||||
|
||||
QMenu *subMenu = new QMenu(menu);
|
||||
|
||||
if (!m_torrent->isSeed()) {
|
||||
subMenu->setTitle(tr("Priority"));
|
||||
QMenu *subMenu = menu->addMenu(tr("Priority"));
|
||||
|
||||
const auto applyPriorities = [this, selectedRows](const BitTorrent::DownloadPriority prio)
|
||||
{
|
||||
|
@ -639,8 +637,6 @@ void PropertiesWidget::displayFilesListMenu(const QPoint &)
|
|||
applyPriorities(BitTorrent::DownloadPriority::Maximum);
|
||||
});
|
||||
subMenu->addAction(m_ui->actionMaximum);
|
||||
|
||||
menu->addMenu(subMenu);
|
||||
}
|
||||
|
||||
// The selected torrent might have disappeared during exec()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue