Fix TorrentHandle path methods. Closes #3847.

This commit is contained in:
Vladimir Golovnev (Glassez) 2015-10-24 15:28:29 +03:00
parent d0ebe08bf5
commit 501ab07024
8 changed files with 89 additions and 52 deletions

View file

@ -142,13 +142,13 @@ void Application::torrentFinished(BitTorrent::TorrentHandle *const torrent)
// AutoRun program
if (pref->isAutoRunEnabled()) {
QString program = pref->getAutoRunProgram();
int file_count = torrent->filesCount();
int fileCount = torrent->filesCount();
program.replace("%N", torrent->name());
program.replace("%F", (file_count > 1) ? "" : torrent->fileName(0));
program.replace("%F", (fileCount > 1) ? "" : torrent->fileName(0));
program.replace("%L", torrent->label());
program.replace("%D", Utils::Fs::toNativePath(torrent->rootPath()));
program.replace("%K", (file_count > 1) ? "multi" : "single");
program.replace("%D", Utils::Fs::toNativePath(torrent->savePath()));
program.replace("%K", (fileCount > 1) ? "multi" : "single");
program.replace("%C", QString::number(torrent->filesCount()));
program.replace("%Z", QString::number(torrent->totalSize()));
program.replace("%T", torrent->currentTracker());