1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-22 20:44:15 +00:00

Fix importing of torrents from qBT < v2.3.0 when using a temporary folder for incomplete torrents

This commit is contained in:
Christophe Dumez 2010-07-08 14:50:23 +00:00
parent 65091f7cb9
commit 9e4958e96a
2 changed files with 15 additions and 4 deletions

View File

@ -879,7 +879,13 @@ QTorrentHandle Bittorrent::addMagnetUri(QString magnet_uri, bool resumed) {
const QString &savePath = getSavePath(hash, false, QString::null, torrent_name);
if(!defaultTempPath.isEmpty() && resumed && !TorrentPersistentData::isSeed(hash)) {
qDebug("addMagnetURI: Temp folder is enabled.");
p.save_path = defaultTempPath.toLocal8Bit().constData();
qDebug("addTorrent::Temp folder is enabled.");
QString torrent_tmp_path = defaultTempPath.replace("\\", "/");
if(!torrent_name.isEmpty()) {
if(!torrent_tmp_path.endsWith("/")) torrent_tmp_path += "/";
torrent_tmp_path += torrent_name;
}
p.save_path = torrent_tmp_path.toLocal8Bit().constData();
qDebug("addMagnetURI: using save_path: %s", qPrintable(defaultTempPath));
} else {
p.save_path = savePath.toLocal8Bit().constData();
@ -1118,7 +1124,12 @@ QTorrentHandle Bittorrent::addTorrent(QString path, bool fromScanDir, QString fr
}
if(!defaultTempPath.isEmpty() && resumed && !TorrentPersistentData::isSeed(hash)) {
qDebug("addTorrent::Temp folder is enabled.");
p.save_path = defaultTempPath.toLocal8Bit().constData();
QString torrent_tmp_path = defaultTempPath.replace("\\", "/");
if(!root_folder.isEmpty()) {
if(!torrent_tmp_path.endsWith("/")) torrent_tmp_path += "/";
torrent_tmp_path += root_folder;
}
p.save_path = torrent_tmp_path.toLocal8Bit().constData();
qDebug("addTorrent: using save_path: %s", qPrintable(defaultTempPath));
} else {
p.save_path = savePath.toLocal8Bit().constData();

View File

@ -12,9 +12,9 @@ CONFIG += qt \
# Update this VERSION for each release
os2 {
DEFINES += VERSION=\'\"v2.3.0rc1\"\'
DEFINES += VERSION=\'\"v2.3.0rc2\"\'
} else {
DEFINES += VERSION=\\\"v2.3.0rc1\\\"
DEFINES += VERSION=\\\"v2.3.0rc2\\\"
}
DEFINES += VERSION_MAJOR=2
DEFINES += VERSION_MINOR=3