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