Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not create save folder in advance. Closes #5422 #5443

Merged
merged 1 commit into from Jul 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/base/bittorrent/session.cpp
Expand Up @@ -1368,9 +1368,6 @@ bool Session::addTorrent_impl(AddTorrentData addData, const MagnetUri &magnetUri
p.max_connections = pref->getMaxConnecsPerTorrent();
p.max_uploads = pref->getMaxUploadsPerTorrent();
p.save_path = Utils::String::toStdString(Utils::Fs::toNativePath(savePath));
// Check if save path exists, creating it otherwise
if (!QDir(savePath).exists())
QDir().mkpath(savePath);

m_addingTorrents.insert(hash, addData);
// Adding torrent to BitTorrent session
Expand Down Expand Up @@ -1460,9 +1457,6 @@ bool Session::loadMetadata(const MagnetUri &magnetUri)

QString savePath = QString("%1/%2").arg(QDir::tempPath()).arg(hash);
p.save_path = Utils::String::toStdString(Utils::Fs::toNativePath(savePath));
// Check if save path exists, creating it otherwise
if (!QDir(savePath).exists())
QDir().mkpath(savePath);

// Forced start
p.flags &= ~libt::add_torrent_params::flag_paused;
Expand Down
4 changes: 0 additions & 4 deletions src/base/bittorrent/torrenthandle.cpp
Expand Up @@ -1284,10 +1284,6 @@ void TorrentHandle::moveStorage(const QString &newPath)
if (QDir(oldPath) == QDir(newPath)) return;

qDebug("move storage: %s to %s", qPrintable(oldPath), qPrintable(newPath));
// Create destination directory if necessary
// or move_storage() will fail...
QDir().mkpath(newPath);

try {
// Actually move the storage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asking precautionary: You have tested now what the comment says, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Besides, I deal with move_storage() internals recently so I know exactly how it works.

m_nativeHandle.move_storage(newPath.toUtf8().constData());
Expand Down