1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

TextEditor: Include extension during SaveAs

When we save-as in the text editor we now auto-populate GFilePicker /w
the current name & extension.
This commit is contained in:
rhin123 2019-07-28 23:45:50 -05:00 committed by Andreas Kling
parent 80cb833594
commit a175e76948
6 changed files with 34 additions and 20 deletions

View file

@ -37,6 +37,11 @@ void FileSystemPath::canonicalize()
}
m_basename = canonical_parts.last();
auto name_parts = m_basename.split('.');
m_title = name_parts[0];
if (name_parts.size() > 1)
m_extension = name_parts[1];
StringBuilder builder(approximate_canonical_length);
for (auto& cpart : canonical_parts) {
builder.append('/');