From 043f7d1e53cec049e6f7656fbdec71f6ada7de75 Mon Sep 17 00:00:00 2001 From: Ruslan Date: Tue, 28 Jan 2025 01:30:08 +0300 Subject: [PATCH] Update torrenttagsdialog.cpp --- src/gui/torrenttagsdialog.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/torrenttagsdialog.cpp b/src/gui/torrenttagsdialog.cpp index a1c57d71e..f99663faf 100644 --- a/src/gui/torrenttagsdialog.cpp +++ b/src/gui/torrenttagsdialog.cpp @@ -25,7 +25,7 @@ * but you are not obligated to do so. If you do not wish to do so, delete this * exception statement from your version. */ - +#include #include "torrenttagsdialog.h" #include @@ -53,18 +53,18 @@ TorrentTagsDialog::TorrentTagsDialog(const TagSet &initialTags, QWidget *parent) connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); - auto *tagsLayout = new FlowLayout(m_ui->scrollArea->widget()); + auto tagsLayout = std::make_unique(m_ui->scrollArea->widget()); for (const Tag &tag : asConst(initialTags.united(BitTorrent::Session::instance()->tags()))) { - auto *tagWidget = new QCheckBox(Utils::Gui::tagToWidgetText(tag)); + auto tagWidget = std::make_unique(Utils::Gui::tagToWidgetText(tag)); if (initialTags.contains(tag)) tagWidget->setChecked(true); - tagsLayout->addWidget(tagWidget); + tagsLayout->addWidget(tagWidget.release()); } - auto *addTagButton = new QPushButton(u"+"_s); - connect(addTagButton, &QPushButton::clicked, this, &TorrentTagsDialog::addNewTag); - tagsLayout->addWidget(addTagButton); + auto addTagButton = std::make_unique(u"+"_s); + connect(addTagButton.get(), &QPushButton::clicked, this, &TorrentTagsDialog::addNewTag); + tagsLayout->addWidget(addTagButton.release()); if (const QSize dialogSize = m_storeDialogSize; dialogSize.isValid()) resize(dialogSize);