Allow to pass torrent comment to external program

PR #22771.
Closes #13186.
This commit is contained in:
Vladimir Golovnev 2025-05-26 15:35:51 +03:00 committed by GitHub
parent a3d1ff0eb2
commit f47754838b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 0 deletions

View file

@ -575,6 +575,9 @@ void Application::runExternalProgram(const QString &programTemplate, const BitTo
case u'L': case u'L':
str.replace(i, 2, torrent->category()); str.replace(i, 2, torrent->category());
break; break;
case u'M':
str.replace(i, 2, torrent->comment());
break;
case u'N': case u'N':
str.replace(i, 2, torrent->name()); str.replace(i, 2, torrent->name());
break; break;

View file

@ -677,6 +677,7 @@ void OptionsDialog::loadDownloadsTabOptions()
, tr("%I: Info hash v1 (or '-' if unavailable)") , tr("%I: Info hash v1 (or '-' if unavailable)")
, tr("%J: Info hash v2 (or '-' if unavailable)") , tr("%J: Info hash v2 (or '-' if unavailable)")
, tr("%K: Torrent ID (either sha-1 info hash for v1 torrent or truncated sha-256 info hash for v2/hybrid torrent)") , tr("%K: Torrent ID (either sha-1 info hash for v1 torrent or truncated sha-256 info hash for v2/hybrid torrent)")
, tr("%M: Comment")
, tr("Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., \"%N\")")); , tr("Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., \"%N\")"));
m_ui->labelAutoRunParam->setText(autoRunStr); m_ui->labelAutoRunParam->setText(autoRunStr);

View file

@ -385,6 +385,7 @@
<li>QBT_TR(%I: Info hash v1)QBT_TR[CONTEXT=OptionsDialog]</li> <li>QBT_TR(%I: Info hash v1)QBT_TR[CONTEXT=OptionsDialog]</li>
<li>QBT_TR(%J: Info hash v2)QBT_TR[CONTEXT=OptionsDialog]</li> <li>QBT_TR(%J: Info hash v2)QBT_TR[CONTEXT=OptionsDialog]</li>
<li>QBT_TR(%K: Torrent ID)QBT_TR[CONTEXT=OptionsDialog]</li> <li>QBT_TR(%K: Torrent ID)QBT_TR[CONTEXT=OptionsDialog]</li>
<li>QBT_TR(%M: Comment)QBT_TR[CONTEXT=OptionsDialog]</li>
</ul> </ul>
QBT_TR(Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., "%N"))QBT_TR[CONTEXT=OptionsDialog] QBT_TR(Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., "%N"))QBT_TR[CONTEXT=OptionsDialog]
</div> </div>