mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Use helper functions to construct smart pointers
This commit is contained in:
parent
ca01b049a6
commit
2157e500ef
7 changed files with 10 additions and 10 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue