From 80684e0316898786bff67550edc5150df3f77c93 Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 12 Dec 2024 08:48:31 +0200 Subject: [PATCH] replace path entities from filename --- .../window/tab/item/identity/gemini/widget/form/save.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/browser/window/tab/item/identity/gemini/widget/form/save.rs b/src/app/browser/window/tab/item/identity/gemini/widget/form/save.rs index 3c081193..838fc18a 100644 --- a/src/app/browser/window/tab/item/identity/gemini/widget/form/save.rs +++ b/src/app/browser/window/tab/item/identity/gemini/widget/form/save.rs @@ -9,7 +9,7 @@ use gtk::{ prelude::{ButtonExt, FileExt, OutputStreamExtManual, WidgetExt}, Button, FileDialog, FileFilter, Window, }; -use std::rc::Rc; +use std::{path::MAIN_SEPARATOR, rc::Rc}; const LABEL: &str = "Export"; const TOOLTIP_TEXT: &str = "Export selected identity to file"; @@ -62,7 +62,10 @@ impl Save { FileDialog::builder() .default_filter(&filter_pem) .filters(&filters) - .initial_name(format!("{}.pem", certificate.name)) + .initial_name(format!( + "{}.pem", + certificate.name.replace(MAIN_SEPARATOR, "-") + )) .build() .save(Window::NONE, Cancellable::NONE, { let button = button.clone();