FontEditor: Don't add duplicate extension in Save As dialog

This commit is contained in:
Nico Weber 2020-07-12 13:39:34 -04:00 committed by Andreas Kling
parent 552789902a
commit ac2470e66e
Notes: sideshowbarker 2024-07-19 04:51:54 +09:00

View file

@ -111,7 +111,8 @@ int main(int argc, char** argv)
}));
app_menu.add_action(GUI::Action::create("Save as...", { Mod_Ctrl | Mod_Shift, Key_S }, Gfx::Bitmap::load_from_file("/res/icons/16x16/save.png"), [&](auto&) {
FontEditorWidget* editor = static_cast<FontEditorWidget*>(window->main_widget());
Optional<String> save_path = GUI::FilePicker::get_save_filepath(editor->path(), ".font");
LexicalPath lexical_path(editor->path());
Optional<String> save_path = GUI::FilePicker::get_save_filepath(lexical_path.title(), lexical_path.extension());
if (!save_path.has_value())
return;