aboutsummaryrefslogtreecommitdiffstats
path: root/keydetailsdialog.cpp
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-08-23 18:50:24 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-08-23 18:50:24 +0000
commit6dd965df7ec9c33d508b24b08b4181a5ebfb46ae (patch)
tree8aec5ab335b61e2111a5b36d98105b4f49afa93c /keydetailsdialog.cpp
parentadded icons for sign and verify and the actions to toolbar (diff)
downloadgpg4usb-6dd965df7ec9c33d508b24b08b4181a5ebfb46ae.tar.gz
gpg4usb-6dd965df7ec9c33d508b24b08b4181a5ebfb46ae.zip
show appropriate filename in key export to file
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@519 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'keydetailsdialog.cpp')
-rw-r--r--keydetailsdialog.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/keydetailsdialog.cpp b/keydetailsdialog.cpp
index 51c472d..4d5bcdc 100644
--- a/keydetailsdialog.cpp
+++ b/keydetailsdialog.cpp
@@ -134,7 +134,6 @@ KeyDetailsDialog::KeyDetailsDialog(GpgME::Context* ctx, gpgme_key_t key)
void KeyDetailsDialog::exportPrivateKey()
{
-
int ret = QMessageBox::information(this, tr("Exporting private Key"),
tr("You are about to export your private key.\n"
"This is NOT your public key, so don't give it away.\n"
@@ -142,11 +141,11 @@ void KeyDetailsDialog::exportPrivateKey()
QMessageBox::Cancel | QMessageBox::Ok);
if (ret == QMessageBox::Ok) {
-
QByteArray *keyArray = new QByteArray();
mCtx->exportSecretKey(*keyid, keyArray);
-
- QString fileName = QFileDialog::getSaveFileName(this, tr("Export Key To File"), "", tr("Key Files ") + " (*.asc *.txt);;All Files (*)");
+ gpgme_key_t key = mCtx->getKeyDetails(*keyid);
+ QString fileString = QString(key->uids->name) + " " + QString(key->uids->email) + "(" + QString(key->subkeys->keyid)+ ")_pub_sec.asc";
+ QString fileName = QFileDialog::getSaveFileName(this, tr("Export Key To File"), fileString, tr("Key Files") + " (*.asc *.txt);;All Files (*)");
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
return;
@@ -155,7 +154,6 @@ void KeyDetailsDialog::exportPrivateKey()
file.close();
delete keyArray;
}
-
}
QString KeyDetailsDialog::beautifyFingerprint(QString fingerprint)