mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 05:13:30 -07:00
BUGFIX: Fix moving of a torrent to an unexisting directory
This commit is contained in:
parent
5b47a762ac
commit
56b88661bc
1 changed files with 4 additions and 0 deletions
|
@ -633,6 +633,10 @@ void QTorrentHandle::move_storage(QString new_path) const {
|
||||||
Q_ASSERT(h.is_valid());
|
Q_ASSERT(h.is_valid());
|
||||||
if(QDir(save_path()) == QDir(new_path)) return;
|
if(QDir(save_path()) == QDir(new_path)) return;
|
||||||
TorrentPersistentData::setPreviousSavePath(hash(), save_path());
|
TorrentPersistentData::setPreviousSavePath(hash(), save_path());
|
||||||
|
// Create destination directory if necessary
|
||||||
|
// or move_storage() will fail...
|
||||||
|
QDir().mkpath(new_path);
|
||||||
|
// Actually move the storage
|
||||||
h.move_storage(new_path.toLocal8Bit().constData());
|
h.move_storage(new_path.toLocal8Bit().constData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue