mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
Merge pull request #3457 from Chocobo1/ext_param
Add more "Run External Program" parameters
This commit is contained in:
commit
fce3a2d5c0
3 changed files with 55 additions and 45 deletions
|
@ -140,11 +140,19 @@ void Application::torrentFinished(BitTorrent::TorrentHandle *const torrent)
|
|||
|
||||
// AutoRun program
|
||||
if (pref->isAutoRunEnabled()) {
|
||||
QString program = pref->getAutoRunProgram().trimmed();
|
||||
// Replace %f by torrent path
|
||||
program.replace("%f", torrent->savePathParsed());
|
||||
// Replace %n by torrent name
|
||||
program.replace("%n", torrent->name());
|
||||
QString program = pref->getAutoRunProgram();
|
||||
int file_count = torrent->filesCount();
|
||||
|
||||
program.replace("%N", torrent->name());
|
||||
program.replace("%F", (file_count > 1) ? "" : torrent->fileName(0));
|
||||
program.replace("%L", torrent->label());
|
||||
program.replace("%D", torrent->rootPath());
|
||||
program.replace("%K", (file_count > 1) ? "multi" : "single");
|
||||
program.replace("%C", QString::number(torrent->filesCount()));
|
||||
program.replace("%Z", QString::number(torrent->totalSize()));
|
||||
program.replace("%T", torrent->currentTracker());
|
||||
program.replace("%I", torrent->hash());
|
||||
|
||||
QProcess::startDetached(program);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue