Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KDE PIM Add-ons
Commits
67359706
Commit
67359706
authored
Apr 19, 2021
by
Laurent Montel
😁
Browse files
Allow to show akonadiUrl
parent
39957193
Pipeline
#58753
canceled with stage
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
plugins/messageviewerplugins/externalscriptplugin/configuredialog/viewerpluginexternaleditwidget.cpp
View file @
67359706
...
...
@@ -47,6 +47,7 @@ ViewerPluginExternalEditWidget::ViewerPluginExternalEditWidget(QWidget *parent)
"<li>%bcc - the list of bcc email address</li>"
"<li>%body - the body of message</li>"
"<li>%inreplyto - the reply email address</li>"
"<li>%akonadiUrl - the akonadi url (as akonadi:?item=187020)</li>"
"</ul>"
"</strong></p></qt>"
);
formatHelp
->
setWhatsThis
(
mCommandWhatsThis
);
...
...
plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.cpp
View file @
67359706
...
...
@@ -42,6 +42,11 @@ void ViewerPluginExternalscriptInterface::refreshActionList(KActionCollection *a
createAction
(
ac
);
}
void
ViewerPluginExternalscriptInterface
::
setMessageItem
(
const
Akonadi
::
Item
&
item
)
{
mAkonadiUrl
=
item
.
url
().
toString
();
}
void
ViewerPluginExternalscriptInterface
::
setMessage
(
const
KMime
::
Message
::
Ptr
&
msg
)
{
mMessage
=
msg
;
...
...
@@ -128,5 +133,6 @@ QStringList ViewerPluginExternalscriptInterface::adaptArguments(const QStringLis
{
ViewerPluginExternalScriptParseArgument
parser
;
parser
.
setMessage
(
mMessage
);
parser
.
setAkonadiUrl
(
mAkonadiUrl
);
return
parser
.
parse
(
scriptArguments
);
}
plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptinterface.h
View file @
67359706
...
...
@@ -25,6 +25,7 @@ public:
void
setText
(
const
QString
&
text
)
override
;
void
setMessage
(
const
KMime
::
Message
::
Ptr
&
msg
)
override
;
void
refreshActionList
(
KActionCollection
*
ac
)
override
;
void
setMessageItem
(
const
Akonadi
::
Item
&
item
)
override
;
private
Q_SLOTS
:
void
slotScriptActivated
(
QAction
*
act
);
...
...
@@ -35,6 +36,7 @@ private:
QStringList
adaptArguments
(
const
QStringList
&
scriptArguments
);
QStringList
mCurrentInfo
;
QString
mText
;
QString
mAkonadiUrl
;
KMime
::
Message
::
Ptr
mMessage
;
QActionGroup
*
mActionGroup
=
nullptr
;
};
...
...
plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptparseargument.cpp
View file @
67359706
...
...
@@ -5,7 +5,7 @@
*/
#include "viewerpluginexternalscriptparseargument.h"
#include <QDebug>
ViewerPluginExternalScriptParseArgument
::
ViewerPluginExternalScriptParseArgument
()
{
}
...
...
@@ -15,6 +15,11 @@ void ViewerPluginExternalScriptParseArgument::setMessage(const KMime::Message::P
mMessage
=
msg
;
}
void
ViewerPluginExternalScriptParseArgument
::
setAkonadiUrl
(
const
QString
&
akonadiUrl
)
{
mAkonadiUrl
=
akonadiUrl
;
}
QStringList
ViewerPluginExternalScriptParseArgument
::
parse
(
const
QStringList
&
scriptArguments
)
{
if
(
mMessage
.
isNull
())
{
...
...
@@ -45,6 +50,8 @@ QStringList ViewerPluginExternalScriptParseArgument::parse(const QStringList &sc
}
else
if
(
arg
==
QLatin1String
(
"%inreplyto"
))
{
KMime
::
Headers
::
InReplyTo
*
inReplyTo
=
mMessage
?
mMessage
->
inReplyTo
(
false
)
:
nullptr
;
newArguments
<<
QStringLiteral
(
"
\"
%1
\"
"
).
arg
(
inReplyTo
?
inReplyTo
->
asUnicodeString
()
:
QString
());
}
else
if
(
arg
==
QLatin1String
(
"%akonadiUrl"
))
{
newArguments
<<
mAkonadiUrl
;
}
else
{
newArguments
<<
arg
;
}
...
...
plugins/messageviewerplugins/externalscriptplugin/viewerpluginexternalscriptparseargument.h
View file @
67359706
...
...
@@ -15,9 +15,12 @@ public:
void
setMessage
(
const
KMime
::
Message
::
Ptr
&
msg
);
QStringList
parse
(
const
QStringList
&
lst
);
Q_REQUIRED_RESULT
QStringList
parse
(
const
QStringList
&
lst
);
void
setAkonadiUrl
(
const
QString
&
akonadiUrl
);
private:
QString
mAkonadiUrl
;
KMime
::
Message
::
Ptr
mMessage
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment