Commit 287325ef authored by Jan Grulich's avatar Jan Grulich

Email portal: add support for attachments

parent 15651a78
......@@ -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));
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment