summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-05-09 13:38:54 +0200
committerMontel Laurent <[email protected]>2016-05-09 13:38:54 +0200
commitd214d298e28ce904a10a27d1c9458e69dcc29633 (patch)
treeb7ca2fdc4ebb144483749762168ada2148159abe
parentef6f4c163958e956f3f8f57f646422b4492e9471 (diff)
Start to implement convert arguments
-rw-r--r--plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.cpp b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.cpp
index cf6c858..92bbfb8 100644
--- a/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.cpp
+++ b/plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.cpp
@@ -128,8 +128,15 @@ void ViewerPluginExternalscriptInterface::slotScriptActivated(QAction *act)
QString ViewerPluginExternalscriptInterface::adaptArguments(const QString &scriptArguments)
{
+ QString newArguments = scriptArguments;
+ if (newArguments.contains(QStringLiteral("%s"))) {
+ const KMime::Headers::Subject *const subject = mMessage ? mMessage->subject(false) : 0;
+ newArguments.replace(QStringLiteral("%s"), QStringLiteral("\"%1\"").arg(subject ? subject->asUnicodeString() : QString()));
+ }
+
+
//TODO %s => subject
// %cc => cc
// etc. Look at parsing in kmkernel.
- return {};
+ return newArguments;
}