mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
Use helper functions to construct smart pointers
This commit is contained in:
@@ -268,7 +268,7 @@ bool AddNewTorrentDialog::loadTorrentFile(const QString &torrentPath)
|
||||
return false;
|
||||
}
|
||||
|
||||
m_torrentGuard.reset(new TorrentFileGuard(decodedPath));
|
||||
m_torrentGuard = std::make_unique<TorrentFileGuard>(decodedPath);
|
||||
|
||||
return loadTorrentImpl();
|
||||
}
|
||||
@@ -310,7 +310,7 @@ bool AddNewTorrentDialog::loadMagnet(const BitTorrent::MagnetUri &magnetUri)
|
||||
return false;
|
||||
}
|
||||
|
||||
m_torrentGuard.reset(new TorrentFileGuard(QString()));
|
||||
m_torrentGuard = std::make_unique<TorrentFileGuard>();
|
||||
m_hash = magnetUri.hash();
|
||||
// Prevent showing the dialog if download is already present
|
||||
if (BitTorrent::Session::instance()->isKnownTorrent(m_hash)) {
|
||||
@@ -678,7 +678,7 @@ void AddNewTorrentDialog::handleDownloadFinished(const Net::DownloadResult &resu
|
||||
return;
|
||||
}
|
||||
|
||||
m_torrentGuard.reset(new TorrentFileGuard);
|
||||
m_torrentGuard = std::make_unique<TorrentFileGuard>();
|
||||
|
||||
if (loadTorrentImpl())
|
||||
open();
|
||||
|
||||
Reference in New Issue
Block a user