aboutsummaryrefslogtreecommitdiffstats
path: root/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r--mainwindow.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp
index b7d8f45..985ee0d 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -929,9 +929,24 @@ void MainWindow::appendSelectedKeys()
return;
}
- QByteArray *keyArray = new QByteArray();
- mCtx->exportKeys(mKeyList->getSelected(), keyArray);
- edit->curTextPage()->append(*keyArray);
+ QStringList expopts;
+ KGpgExport *exp = new KGpgExport(this, *mKeyList->getSelected(), expopts);
+ connect(exp, SIGNAL(done(int)), SLOT(slotAppendSelectedKeysReady(int)));
+ exp->start();
+}
+
+void MainWindow::slotAppendSelectedKeysReady(int result) {
+ KGpgExport *exp = qobject_cast<KGpgExport *>(sender());
+ Q_ASSERT(exp != NULL);
+
+ if (result == KGpgTransaction::TS_OK) {
+ edit->curTextPage()->append(QLatin1String( exp->getOutputData() ));
+ } else {
+ //KMessageBox::sorry(this, i18n("Your public key could not be exported\nCheck the key."));
+ qDebug() << "Your public key could not be exported\nCheck the key.";
+ }
+
+ exp->deleteLater();
}
void MainWindow::copyMailAddressToClipboard()