Don't replace existing files when relocating torrent

This commit is contained in:
Vladimir Golovnev (qlassez)
2017-08-05 15:51:53 +03:00
parent 6043584305
commit 7d78457fe0
2 changed files with 41 additions and 34 deletions

View File

@@ -421,8 +421,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);
@@ -437,11 +437,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;