From 56b88661bcd12db9abd91f8bde8e1899bb8710f1 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 17 Oct 2010 15:17:39 +0000 Subject: [PATCH] BUGFIX: Fix moving of a torrent to an unexisting directory --- src/qtlibtorrent/qtorrenthandle.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qtlibtorrent/qtorrenthandle.cpp b/src/qtlibtorrent/qtorrenthandle.cpp index 02fb4312b..5934a96ad 100644 --- a/src/qtlibtorrent/qtorrenthandle.cpp +++ b/src/qtlibtorrent/qtorrenthandle.cpp @@ -633,6 +633,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()); }