summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2016-06-06 13:55:07 (GMT)
committerRolf Eike Beer <kde@opensource.sf-tec.de>2016-06-06 16:50:19 (GMT)
commit2f9ec03fdb60244cbb33aa479032300d1b45c885 (patch)
tree8504cad20c84ed23e16b160e5906ad9cebb5bc7a
parent54f4560964c62d309f91a8ba010839c8efc5932c (diff)
port away from KToolInvocation::invokeMailer()
-rw-r--r--caff.cpp8
-rw-r--r--keysmanager.cpp5
2 files changed, 7 insertions, 6 deletions
diff --git a/caff.cpp b/caff.cpp
index 37f8646..a3fb15c 100644
--- a/caff.cpp
+++ b/caff.cpp
@@ -27,9 +27,9 @@
#include <KDebug>
#include <KLocale>
-#include <KToolInvocation>
#include <KMessageBox>
+#include <QDesktopServices>
#include <QDir>
#include <QFileInfo>
#include <QTemporaryDir>
@@ -354,9 +354,9 @@ KGpgCaffPrivate::slotTextEncrypted(int result)
const QString email = uid->getEmail();
const QString keyid = uid->getKeyNode()->getId();
- KToolInvocation::invokeMailer(email, QString(), QString(),
- i18nc("%1 is 64 bit key id (in hex), text is used as email subject", "Your key %1", keyid),
- text);
+ QDesktopServices::openUrl(QUrl(QLatin1String("mailto:") + email +
+ QLatin1String("?subject=") + i18nc("%1 is 64 bit key id (in hex), text is used as email subject", "Your key %1", keyid) +
+ QLatin1String("?body=") + text));
break;
}
default:
diff --git a/keysmanager.cpp b/keysmanager.cpp
index 0963fb7..57b488b 100644
--- a/keysmanager.cpp
+++ b/keysmanager.cpp
@@ -84,6 +84,7 @@
#include <QApplication>
#include <QClipboard>
#include <QDBusConnection>
+#include <QDesktopServices>
#include <QDir>
#include <QEvent>
#include <QFileDialog>
@@ -1520,7 +1521,7 @@ void KeysManager::slotProcessExportMail(int result)
// start default Mail application
if (result == KGpgTransaction::TS_OK) {
- KToolInvocation::invokeMailer(QString(), QString(), QString(), QString(),QLatin1String( exp->getOutputData() ));
+ QDesktopServices::openUrl(QUrl(QLatin1String("mailto:?body=") + QLatin1String(exp->getOutputData())));
} else {
KMessageBox::sorry(this, i18n("Your public key could not be exported\nCheck the key."));
}
@@ -2252,7 +2253,7 @@ void KeysManager::slotSendEmail()
if (maillist.isEmpty())
return;
- KToolInvocation::invokeMailer(maillist.join(QLatin1String(", ")), QString());
+ QDesktopServices::openUrl(QUrl(QLatin1String("mailto:") + maillist.join(QLatin1String(", "))));
}
void KeysManager::slotedit()