1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-24 21:44:25 +00:00

- Fix "start seeding immediately after torrent creation" feature (save path was not set right)

This commit is contained in:
Christophe Dumez 2009-11-29 09:01:33 +00:00
parent 6ede368f63
commit d9817795ed

View File

@ -46,6 +46,7 @@
#include <libtorrent/file_pool.hpp> #include <libtorrent/file_pool.hpp>
#include <libtorrent/create_torrent.hpp> #include <libtorrent/create_torrent.hpp>
#include "torrentpersistentdata.h"
#include "createtorrent_imp.h" #include "createtorrent_imp.h"
#include "misc.h" #include "misc.h"
@ -188,7 +189,7 @@ void createtorrent::handleCreationFailure(QString msg) {
void createtorrent::handleCreationSuccess(QString path, const char* branch_path) { void createtorrent::handleCreationSuccess(QString path, const char* branch_path) {
if(checkStartSeeding->isChecked()) { if(checkStartSeeding->isChecked()) {
// Create save path file // Create save path temp data
boost::intrusive_ptr<torrent_info> t; boost::intrusive_ptr<torrent_info> t;
try { try {
t = new torrent_info(path.toLocal8Bit().data()); t = new torrent_info(path.toLocal8Bit().data());
@ -197,10 +198,7 @@ void createtorrent::handleCreationSuccess(QString path, const char* branch_path)
return; return;
} }
QString hash = misc::toQString(t->info_hash()); QString hash = misc::toQString(t->info_hash());
QFile savepath_file(misc::qBittorrentPath()+QString::fromUtf8("BT_backup")+QDir::separator()+hash+QString::fromUtf8(".savepath")); TorrentTempData::setSavePath(hash, QString(branch_path));
savepath_file.open(QIODevice::WriteOnly | QIODevice::Text);
savepath_file.write(branch_path);
savepath_file.close();
emit torrent_to_seed(path); emit torrent_to_seed(path);
} }
QMessageBox::information(0, tr("Torrent creation"), tr("Torrent was created successfully:")+" "+path); QMessageBox::information(0, tr("Torrent creation"), tr("Torrent was created successfully:")+" "+path);