Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE Portal for XDG Desktop
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
KDE Portal for XDG Desktop
Commits
287325ef
Commit
287325ef
authored
Oct 27, 2017
by
Jan Grulich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Email portal: add support for attachments
parent
15651a78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
src/email.cpp
src/email.cpp
+10
-6
No files found.
src/email.cpp
View file @
287325ef
...
...
@@ -45,12 +45,16 @@ uint EmailPortal::ComposeEmail(const QDBusObjectPath &handle, const QString &app
qCDebug
(
XdgDesktopPortalKdeEmail
)
<<
" window: "
<<
window
;
qCDebug
(
XdgDesktopPortalKdeEmail
)
<<
" options: "
<<
options
;
// TODO attachements
const
QString
mailtoUrl
=
QStringLiteral
(
"mailto:%1?subject=%2&body=%3"
).
arg
(
options
.
value
(
QLatin1String
(
"address"
)).
toString
())
.
arg
(
options
.
value
(
QLatin1String
(
"subject"
)).
toString
())
.
arg
(
options
.
value
(
QLatin1String
(
"body"
)).
toString
());
qCDebug
(
XdgDesktopPortalKdeEmail
)
<<
"Mailto url: "
<<
mailtoUrl
;
QString
attachmentString
;
const
QStringList
attachments
=
options
.
value
(
QLatin1String
(
"attachments"
)).
toStringList
();
Q_FOREACH
(
const
QString
&
attachment
,
attachments
)
{
attachmentString
+=
QStringLiteral
(
"&attachment=%1"
).
arg
(
attachment
);
}
const
QString
mailtoUrl
=
QStringLiteral
(
"mailto:%1?subject=%2&body=%3%4"
).
arg
(
options
.
value
(
QLatin1String
(
"address"
)).
toString
())
.
arg
(
options
.
value
(
QLatin1String
(
"subject"
)).
toString
())
.
arg
(
options
.
value
(
QLatin1String
(
"body"
)).
toString
())
.
arg
(
attachmentString
);
return
QDesktopServices
::
openUrl
(
QUrl
(
mailtoUrl
));
}
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