mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-25 05:54:33 +00:00
parent
c90863f217
commit
1c654d8f47
@ -4963,6 +4963,11 @@ void SessionImpl::handleTorrentInfoHashChanged(TorrentImpl *torrent, const InfoH
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SessionImpl::handleTorrentStorageMovingStateChanged(TorrentImpl *torrent)
|
||||||
|
{
|
||||||
|
emit torrentsUpdated({torrent});
|
||||||
|
}
|
||||||
|
|
||||||
bool SessionImpl::addMoveTorrentStorageJob(TorrentImpl *torrent, const Path &newPath, const MoveStorageMode mode, const MoveStorageContext context)
|
bool SessionImpl::addMoveTorrentStorageJob(TorrentImpl *torrent, const Path &newPath, const MoveStorageMode mode, const MoveStorageContext context)
|
||||||
{
|
{
|
||||||
Q_ASSERT(torrent);
|
Q_ASSERT(torrent);
|
||||||
|
@ -451,6 +451,7 @@ namespace BitTorrent
|
|||||||
void handleTorrentUrlSeedsRemoved(TorrentImpl *torrent, const QVector<QUrl> &urlSeeds);
|
void handleTorrentUrlSeedsRemoved(TorrentImpl *torrent, const QVector<QUrl> &urlSeeds);
|
||||||
void handleTorrentResumeDataReady(TorrentImpl *torrent, const LoadTorrentParams &data);
|
void handleTorrentResumeDataReady(TorrentImpl *torrent, const LoadTorrentParams &data);
|
||||||
void handleTorrentInfoHashChanged(TorrentImpl *torrent, const InfoHash &prevInfoHash);
|
void handleTorrentInfoHashChanged(TorrentImpl *torrent, const InfoHash &prevInfoHash);
|
||||||
|
void handleTorrentStorageMovingStateChanged(TorrentImpl *torrent);
|
||||||
|
|
||||||
bool addMoveTorrentStorageJob(TorrentImpl *torrent, const Path &newPath, MoveStorageMode mode, MoveStorageContext context);
|
bool addMoveTorrentStorageJob(TorrentImpl *torrent, const Path &newPath, MoveStorageMode mode, MoveStorageContext context);
|
||||||
|
|
||||||
|
@ -1778,9 +1778,13 @@ void TorrentImpl::moveStorage(const Path &newPath, const MoveStorageContext cont
|
|||||||
const auto mode = (context == MoveStorageContext::AdjustCurrentLocation)
|
const auto mode = (context == MoveStorageContext::AdjustCurrentLocation)
|
||||||
? MoveStorageMode::Overwrite : MoveStorageMode::KeepExistingFiles;
|
? MoveStorageMode::Overwrite : MoveStorageMode::KeepExistingFiles;
|
||||||
if (m_session->addMoveTorrentStorageJob(this, newPath, mode, context))
|
if (m_session->addMoveTorrentStorageJob(this, newPath, mode, context))
|
||||||
|
{
|
||||||
|
if (!m_storageIsMoving)
|
||||||
{
|
{
|
||||||
m_storageIsMoving = true;
|
m_storageIsMoving = true;
|
||||||
updateState();
|
updateState();
|
||||||
|
m_session->handleTorrentStorageMovingStateChanged(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1813,6 +1817,9 @@ void TorrentImpl::handleMoveStorageJobFinished(const Path &path, const MoveStora
|
|||||||
|
|
||||||
if (!m_storageIsMoving)
|
if (!m_storageIsMoving)
|
||||||
{
|
{
|
||||||
|
updateState();
|
||||||
|
m_session->handleTorrentStorageMovingStateChanged(this);
|
||||||
|
|
||||||
if (m_hasMissingFiles)
|
if (m_hasMissingFiles)
|
||||||
{
|
{
|
||||||
// it can be moved to the proper location
|
// it can be moved to the proper location
|
||||||
|
Loading…
x
Reference in New Issue
Block a user