Merge pull request #10934 from Chocobo1/delete

Rely on Qt ownership to delete class members
This commit is contained in:
Mike Tzou 2019-07-17 12:02:30 +08:00 committed by GitHub
commit 1e70c52e7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 275 additions and 306 deletions

View file

@ -82,7 +82,7 @@ PropertiesWidget::PropertiesWidget(QWidget *parent)
m_state = VISIBLE;
// Set Properties list model
m_propListModel = new TorrentContentFilterModel();
m_propListModel = new TorrentContentFilterModel(this);
m_ui->filesList->setModel(m_propListModel);
m_propListDelegate = new PropListDelegate(this);
m_ui->filesList->setItemDelegate(m_propListDelegate);
@ -142,7 +142,7 @@ PropertiesWidget::PropertiesWidget(QWidget *parent)
m_peerList = new PeerListWidget(this);
m_ui->vBoxLayoutPeerPage->addWidget(m_peerList);
// Tab bar
m_tabBar = new PropTabBar();
m_tabBar = new PropTabBar(nullptr);
m_tabBar->setContentsMargins(0, 5, 0, 0);
m_ui->verticalLayout->addLayout(m_tabBar);
connect(m_tabBar, &PropTabBar::tabChanged, m_ui->stackedProperties, &QStackedWidget::setCurrentIndex);
@ -168,17 +168,8 @@ PropertiesWidget::PropertiesWidget(QWidget *parent)
PropertiesWidget::~PropertiesWidget()
{
qDebug() << Q_FUNC_INFO << "ENTER";
delete m_trackerList;
delete m_peerList;
delete m_speedWidget;
delete m_downloadedPieces;
delete m_piecesAvailability;
delete m_propListModel;
delete m_propListDelegate;
delete m_tabBar;
delete m_ui;
qDebug() << Q_FUNC_INFO << "EXIT";
}
void PropertiesWidget::showPiecesAvailability(bool show)