Don't replace existing files when relocating torrent

This commit is contained in:
Vladimir Golovnev (qlassez)
2017-08-05 15:51:53 +03:00
committed by sledgehammer999
parent 61281dd226
commit 4e596629fd
2 changed files with 41 additions and 34 deletions

View File

@@ -422,8 +422,8 @@ namespace BitTorrent
void adjustActualSavePath();
void adjustActualSavePath_impl();
void move_impl(QString path);
void moveStorage(const QString &newPath);
void move_impl(QString path, bool overwrite);
void moveStorage(const QString &newPath, bool overwrite);
void manageIncompleteFiles();
bool addTracker(const TrackerEntry &tracker);
bool addUrlSeed(const QUrl &urlSeed);
@@ -438,11 +438,16 @@ namespace BitTorrent
InfoHash m_hash;
QString m_oldPath;
QString m_newPath;
// m_queuedPath is where files should be moved to,
// when current moving is completed
QString m_queuedPath;
struct
{
QString oldPath;
QString newPath;
// queuedPath is where files should be moved to,
// when current moving is completed
QString queuedPath;
bool queuedOverwrite = true;
} m_moveStorageInfo;
// m_moveFinishedTriggers is activated only when the following conditions are met:
// all file rename jobs complete, all file move jobs complete
QQueue<EventTrigger> m_moveFinishedTriggers;