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:
parent
5caaa52bee
commit
628c7f094f
4 changed files with 12 additions and 9 deletions
|
@ -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 {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue