mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 07:57:22 -06:00
Manage save path in one place
This commit is contained in:
@@ -65,10 +65,31 @@ static const char QB_EXT[] = ".!qB";
|
||||
namespace libt = libtorrent;
|
||||
using namespace BitTorrent;
|
||||
|
||||
// TrackerInfo
|
||||
// AddTorrentData
|
||||
|
||||
TrackerInfo::TrackerInfo()
|
||||
: numPeers(0)
|
||||
AddTorrentData::AddTorrentData()
|
||||
: resumed(false)
|
||||
, disableTempPath(false)
|
||||
, sequential(false)
|
||||
, hasSeedStatus(false)
|
||||
, skipChecking(false)
|
||||
, ratioLimit(TorrentHandle::USE_GLOBAL_RATIO)
|
||||
{
|
||||
}
|
||||
|
||||
AddTorrentData::AddTorrentData(const AddTorrentParams ¶ms)
|
||||
: resumed(false)
|
||||
, name(params.name)
|
||||
, label(params.label)
|
||||
, savePath(params.savePath)
|
||||
, disableTempPath(params.disableTempPath)
|
||||
, sequential(params.sequential)
|
||||
, hasSeedStatus(params.skipChecking) // do not react on 'torrent_finished_alert' when skipping
|
||||
, skipChecking(params.skipChecking)
|
||||
, addForced(params.addForced)
|
||||
, addPaused(params.addPaused)
|
||||
, filePriorities(params.filePriorities)
|
||||
, ratioLimit(params.ignoreShareRatio ? TorrentHandle::NO_RATIO_LIMIT : TorrentHandle::USE_GLOBAL_RATIO)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -188,7 +209,11 @@ TorrentHandle::TorrentHandle(Session *session, const libtorrent::torrent_handle
|
||||
, m_pauseAfterRecheck(false)
|
||||
, m_needSaveResumeData(false)
|
||||
{
|
||||
initialize();
|
||||
Q_ASSERT(!m_savePath.isEmpty());
|
||||
|
||||
updateStatus();
|
||||
m_hash = InfoHash(m_nativeStatus.info_hash);
|
||||
adjustActualSavePath();
|
||||
|
||||
if (!data.resumed) {
|
||||
setSequentialDownload(data.sequential);
|
||||
@@ -1704,13 +1729,6 @@ void TorrentHandle::updateTorrentInfo()
|
||||
#endif
|
||||
}
|
||||
|
||||
void TorrentHandle::initialize()
|
||||
{
|
||||
updateStatus();
|
||||
m_hash = InfoHash(m_nativeStatus.info_hash);
|
||||
adjustActualSavePath();
|
||||
}
|
||||
|
||||
bool TorrentHandle::isMoveInProgress() const
|
||||
{
|
||||
return !m_newPath.isEmpty();
|
||||
|
||||
Reference in New Issue
Block a user