mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Fixed v1.4.x torrent import
This commit is contained in:
parent
6e87d6655a
commit
e2dc2207d8
2 changed files with 29 additions and 3 deletions
|
@ -757,7 +757,20 @@ void bittorrent::importOldTorrents() {
|
||||||
QPair<int, QString> fileName;
|
QPair<int, QString> fileName;
|
||||||
foreach(fileName, filePaths) {
|
foreach(fileName, filePaths) {
|
||||||
importOldTempData(fileName.second);
|
importOldTempData(fileName.second);
|
||||||
addTorrent(fileName.second, false, QString(), true);
|
QTorrentHandle h = addTorrent(fileName.second, false, QString(), true);
|
||||||
|
// Sequential download
|
||||||
|
if(TorrentTempData::hasTempData(h.hash())) {
|
||||||
|
qDebug("addTorrent: Setting download as sequential (from tmp data)");
|
||||||
|
h.set_sequential_download(TorrentTempData::isSequential(h.hash()));
|
||||||
|
}
|
||||||
|
QString savePath = TorrentTempData::getSavePath(h.hash());
|
||||||
|
// Save persistent data for new torrent
|
||||||
|
TorrentPersistentData::saveTorrentPersistentData(h);
|
||||||
|
// Save save_path
|
||||||
|
if(!defaultTempPath.isEmpty() && !savePath.isNull()) {
|
||||||
|
qDebug("addTorrent: Saving save_path in persistent data: %s", savePath.toLocal8Bit().data());
|
||||||
|
TorrentPersistentData::saveSavePath(h.hash(), savePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QStringList filePaths;
|
QStringList filePaths;
|
||||||
|
@ -767,7 +780,20 @@ void bittorrent::importOldTorrents() {
|
||||||
// Resume downloads
|
// Resume downloads
|
||||||
foreach(const QString &fileName, filePaths) {
|
foreach(const QString &fileName, filePaths) {
|
||||||
importOldTempData(fileName);
|
importOldTempData(fileName);
|
||||||
addTorrent(fileName, false, QString(), true);
|
QTorrentHandle h = addTorrent(fileName, false, QString(), true);
|
||||||
|
// Sequential download
|
||||||
|
if(TorrentTempData::hasTempData(h.hash())) {
|
||||||
|
qDebug("addTorrent: Setting download as sequential (from tmp data)");
|
||||||
|
h.set_sequential_download(TorrentTempData::isSequential(h.hash()));
|
||||||
|
}
|
||||||
|
QString savePath = TorrentTempData::getSavePath(h.hash());
|
||||||
|
// Save persistent data for new torrent
|
||||||
|
TorrentPersistentData::saveTorrentPersistentData(h);
|
||||||
|
// Save save_path
|
||||||
|
if(!defaultTempPath.isEmpty() && !savePath.isNull()) {
|
||||||
|
qDebug("addTorrent: Saving save_path in persistent data: %s", savePath.toLocal8Bit().data());
|
||||||
|
TorrentPersistentData::saveSavePath(h.hash(), savePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
settings.setValue("v1_4_x_torrent_imported", true);
|
settings.setValue("v1_4_x_torrent_imported", true);
|
||||||
|
|
|
@ -14,7 +14,7 @@ CONFIG += qt \
|
||||||
network
|
network
|
||||||
|
|
||||||
# Update this VERSION for each release
|
# Update this VERSION for each release
|
||||||
DEFINES += VERSION=\\\"v1.5.0rc1\\\"
|
DEFINES += VERSION=\\\"v1.5.0rc2\\\"
|
||||||
DEFINES += VERSION_MAJOR=1
|
DEFINES += VERSION_MAJOR=1
|
||||||
DEFINES += VERSION_MINOR=5
|
DEFINES += VERSION_MINOR=5
|
||||||
DEFINES += VERSION_BUGFIX=0
|
DEFINES += VERSION_BUGFIX=0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue