From 8047495b2e5a18262a61946228b736e7304b2f20 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 17 Oct 2010 15:16:25 +0000 Subject: [PATCH] BUGFIX: Fix moving of a torrent to an unexisting directory --- Changelog | 1 + src/qtorrenthandle.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Changelog b/Changelog index 432f44bd8..bbb1daf8a 100644 --- a/Changelog +++ b/Changelog @@ -2,6 +2,7 @@ - BUGFIX: Fix "torrent seeding after creation" feature - BUGFIX: The properties panel data would sometimes not match the selected torrent - BUGFIX: Fix detection of files at final destination when temp dir is used + - BUGFIX: Fix moving of a torrent to an unexisting directory * Tue Oct 12 2010 - Christophe Dumez - v2.4.5 - BUGFIX: Remember torrent completion date correctly diff --git a/src/qtorrenthandle.cpp b/src/qtorrenthandle.cpp index 27e56d2ab..f4d63248d 100644 --- a/src/qtorrenthandle.cpp +++ b/src/qtorrenthandle.cpp @@ -629,6 +629,10 @@ void QTorrentHandle::move_storage(QString new_path) const { Q_ASSERT(h.is_valid()); if(QDir(save_path()) == QDir(new_path)) return; 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()); }