From af2ac8a8577e35b711960de1af64b329cdd28290 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Sun, 25 May 2025 11:41:02 +0300 Subject: [PATCH] Allow to pass torrent comment to external program Closes #13186. --- src/app/application.cpp | 3 +++ src/gui/optionsdialog.cpp | 1 + src/webui/www/private/views/preferences.html | 1 + 3 files changed, 5 insertions(+) diff --git a/src/app/application.cpp b/src/app/application.cpp index 8fe47033e..da09211bd 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -575,6 +575,9 @@ void Application::runExternalProgram(const QString &programTemplate, const BitTo case u'L': str.replace(i, 2, torrent->category()); break; + case u'M': + str.replace(i, 2, torrent->comment()); + break; case u'N': str.replace(i, 2, torrent->name()); break; diff --git a/src/gui/optionsdialog.cpp b/src/gui/optionsdialog.cpp index 114f3004f..84d98db7c 100644 --- a/src/gui/optionsdialog.cpp +++ b/src/gui/optionsdialog.cpp @@ -677,6 +677,7 @@ void OptionsDialog::loadDownloadsTabOptions() , tr("%I: Info hash v1 (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("%M: Comment") , tr("Tip: Encapsulate parameter with quotation marks to avoid text being cut off at whitespace (e.g., \"%N\")")); m_ui->labelAutoRunParam->setText(autoRunStr); diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html index a4cf7e5ae..f6f2e97d4 100644 --- a/src/webui/www/private/views/preferences.html +++ b/src/webui/www/private/views/preferences.html @@ -385,6 +385,7 @@
  • QBT_TR(%I: Info hash v1)QBT_TR[CONTEXT=OptionsDialog]
  • QBT_TR(%J: Info hash v2)QBT_TR[CONTEXT=OptionsDialog]
  • QBT_TR(%K: Torrent ID)QBT_TR[CONTEXT=OptionsDialog]
  • +
  • QBT_TR(%M: Comment)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]