diff options
author | Saturneric <[email protected]> | 2023-03-30 17:22:42 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2023-03-30 17:22:42 +0000 |
commit | 4d3076ebc1cb2c10fb94721ce55c83238a205d8b (patch) | |
tree | 6a383328c3a1db803215a581d12f22e67d701e7b | |
parent | fix: correct ui representation (diff) | |
download | GpgFrontend-4d3076ebc1cb2c10fb94721ce55c83238a205d8b.tar.gz GpgFrontend-4d3076ebc1cb2c10fb94721ce55c83238a205d8b.zip |
fix: solve export key filename issues on windows
-rw-r--r-- | src/ui/dialog/keypair_details/KeyPairOperaTab.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp b/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp index a1452033..59f3f7cf 100644 --- a/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp +++ b/src/ui/dialog/keypair_details/KeyPairOperaTab.cpp @@ -147,8 +147,13 @@ void KeyPairOperaTab::slot_export_public_key() { } // generate a file name +#ifndef WINDOWS auto file_string = m_key_.GetName() + "<" + m_key_.GetEmail() + ">(" + m_key_.GetId() + ")_pub.asc"; +#else + auto file_string = m_key_.GetName() + "[" + m_key_.GetEmail() + "](" + + m_key_.GetId() + ")_pub.asc"; +#endif std::replace(file_string.begin(), file_string.end(), ' ', '_'); auto file_name = @@ -193,8 +198,14 @@ void KeyPairOperaTab::slot_export_short_private_key() { return; } + // generate a file name +#ifndef WINDOWS auto file_string = m_key_.GetName() + "<" + m_key_.GetEmail() + ">(" + m_key_.GetId() + ")_short_secret.asc"; +#else + auto file_string = m_key_.GetName() + "[" + m_key_.GetEmail() + "](" + + m_key_.GetId() + ")_short_secret.asc"; +#endif std::replace(file_string.begin(), file_string.end(), ' ', '_'); auto file_name = @@ -235,8 +246,15 @@ void KeyPairOperaTab::slot_export_private_key() { _("An error occurred during the export operation.")); return; } + + // generate a file name +#ifndef WINDOWS auto file_string = m_key_.GetName() + "<" + m_key_.GetEmail() + ">(" + m_key_.GetId() + ")_full_secret.asc"; +#else + auto file_string = m_key_.GetName() + "[" + m_key_.GetEmail() + "](" + + m_key_.GetId() + ")_full_secret.asc"; +#endif std::replace(file_string.begin(), file_string.end(), ' ', '_'); auto file_name = |