1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:48:11 +00:00

LibGUI+Shell+bt+ls: Use proper APIs for creating file URLs

This patch replaces ad-hoc generation of file URL strings with using
URL::create_with_file_scheme().
This commit is contained in:
Max Wipfli 2021-05-29 23:15:54 +02:00 committed by Andreas Kling
parent 5caaa52bee
commit 628c7f094f
4 changed files with 12 additions and 9 deletions

View file

@ -439,12 +439,8 @@ Variant FileSystemModel::data(const ModelIndex& index, ModelRole role) const
}
if (role == ModelRole::MimeData) {
if (index.column() == Column::Name) {
StringBuilder builder;
builder.append("file://");
builder.append(node.full_path());
return builder.to_string();
}
if (index.column() == Column::Name)
return URL::create_with_file_scheme(node.full_path()).serialize();
return {};
}