aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2022-05-12 16:42:03 +0000
committerSaturneric <[email protected]>2022-05-12 16:42:03 +0000
commite6333387c962ef0e9b671ab1c62f0baac62efd78 (patch)
tree107e3459a2df4fa817d094c3f41685181ae2db48
parentdoc: update _sidebar.md (diff)
downloadGpgFrontend-e6333387c962ef0e9b671ab1c62f0baac62efd78.tar.gz
GpgFrontend-e6333387c962ef0e9b671ab1c62f0baac62efd78.zip
fix(ui): remove spaces in export key filename
-rw-r--r--src/ui/keypair_details/KeyPairOperaTab.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/ui/keypair_details/KeyPairOperaTab.cpp b/src/ui/keypair_details/KeyPairOperaTab.cpp
index 988ce527..4f7cd66f 100644
--- a/src/ui/keypair_details/KeyPairOperaTab.cpp
+++ b/src/ui/keypair_details/KeyPairOperaTab.cpp
@@ -145,8 +145,12 @@ void KeyPairOperaTab::slot_export_public_key() {
_("An error occurred during the export operation."));
return;
}
- auto file_string = m_key_.GetName() + " " + m_key_.GetEmail() + "(" +
+
+ // generate a file name
+ auto file_string = m_key_.GetName() + "<" + m_key_.GetEmail() + ">(" +
m_key_.GetId() + ")_pub.asc";
+ std::replace(file_string.begin(), file_string.end(), ' ', '_');
+
auto file_name =
QFileDialog::getSaveFileName(
this, _("Export Key To File"), QString::fromStdString(file_string),
@@ -188,8 +192,11 @@ void KeyPairOperaTab::slot_export_short_private_key() {
_("An error occurred during the export operation."));
return;
}
- auto file_string = m_key_.GetName() + " " + m_key_.GetEmail() + "(" +
+
+ auto file_string = m_key_.GetName() + "<" + m_key_.GetEmail() + ">(" +
m_key_.GetId() + ")_short_secret.asc";
+ std::replace(file_string.begin(), file_string.end(), ' ', '_');
+
auto file_name =
QFileDialog::getSaveFileName(
this, _("Export Key To File"), QString::fromStdString(file_string),
@@ -228,8 +235,10 @@ void KeyPairOperaTab::slot_export_private_key() {
_("An error occurred during the export operation."));
return;
}
- auto file_string = m_key_.GetName() + " " + m_key_.GetEmail() + "(" +
+ auto file_string = m_key_.GetName() + "<" + m_key_.GetEmail() + ">(" +
m_key_.GetId() + ")_full_secret.asc";
+ std::replace(file_string.begin(), file_string.end(), ' ', '_');
+
auto file_name =
QFileDialog::getSaveFileName(
this, _("Export Key To File"), QString::fromStdString(file_string),