mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 10:46:04 +03:00
Don't forget to delete TorrentContentAdaptor instance
PR #19825. Closes #19816.
This commit is contained in:
parent
3c0747fb87
commit
d5c0c094f2
2 changed files with 4 additions and 4 deletions
|
@ -767,7 +767,7 @@ void AddNewTorrentDialog::contentLayoutChanged()
|
||||||
|
|
||||||
const auto contentLayout = static_cast<BitTorrent::TorrentContentLayout>(m_ui->contentLayoutComboBox->currentIndex());
|
const auto contentLayout = static_cast<BitTorrent::TorrentContentLayout>(m_ui->contentLayoutComboBox->currentIndex());
|
||||||
m_contentAdaptor->applyContentLayout(contentLayout);
|
m_contentAdaptor->applyContentLayout(contentLayout);
|
||||||
m_ui->contentTreeView->setContentHandler(m_contentAdaptor); // to cause reloading
|
m_ui->contentTreeView->setContentHandler(m_contentAdaptor.get()); // to cause reloading
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddNewTorrentDialog::saveTorrentFile()
|
void AddNewTorrentDialog::saveTorrentFile()
|
||||||
|
@ -992,7 +992,7 @@ void AddNewTorrentDialog::setupTreeview()
|
||||||
if (m_torrentParams.filePaths.isEmpty())
|
if (m_torrentParams.filePaths.isEmpty())
|
||||||
m_torrentParams.filePaths = m_torrentInfo.filePaths();
|
m_torrentParams.filePaths = m_torrentInfo.filePaths();
|
||||||
|
|
||||||
m_contentAdaptor = new TorrentContentAdaptor(m_torrentInfo, m_torrentParams.filePaths, m_torrentParams.filePriorities);
|
m_contentAdaptor = std::make_unique<TorrentContentAdaptor>(m_torrentInfo, m_torrentParams.filePaths, m_torrentParams.filePriorities);
|
||||||
|
|
||||||
const auto contentLayout = static_cast<BitTorrent::TorrentContentLayout>(m_ui->contentLayoutComboBox->currentIndex());
|
const auto contentLayout = static_cast<BitTorrent::TorrentContentLayout>(m_ui->contentLayoutComboBox->currentIndex());
|
||||||
m_contentAdaptor->applyContentLayout(contentLayout);
|
m_contentAdaptor->applyContentLayout(contentLayout);
|
||||||
|
@ -1013,7 +1013,7 @@ void AddNewTorrentDialog::setupTreeview()
|
||||||
m_contentAdaptor->prioritizeFiles(priorities);
|
m_contentAdaptor->prioritizeFiles(priorities);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui->contentTreeView->setContentHandler(m_contentAdaptor);
|
m_ui->contentTreeView->setContentHandler(m_contentAdaptor.get());
|
||||||
|
|
||||||
m_filterLine->blockSignals(false);
|
m_filterLine->blockSignals(false);
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ private:
|
||||||
void showEvent(QShowEvent *event) override;
|
void showEvent(QShowEvent *event) override;
|
||||||
|
|
||||||
Ui::AddNewTorrentDialog *m_ui = nullptr;
|
Ui::AddNewTorrentDialog *m_ui = nullptr;
|
||||||
TorrentContentAdaptor *m_contentAdaptor = nullptr;
|
std::unique_ptr<TorrentContentAdaptor> m_contentAdaptor;
|
||||||
BitTorrent::MagnetUri m_magnetURI;
|
BitTorrent::MagnetUri m_magnetURI;
|
||||||
BitTorrent::TorrentInfo m_torrentInfo;
|
BitTorrent::TorrentInfo m_torrentInfo;
|
||||||
int m_savePathIndex = -1;
|
int m_savePathIndex = -1;
|
||||||
|
|
Loading…
Reference in a new issue