mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +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
Notes:
sideshowbarker
2024-07-18 17:03:38 +09:00
Author: https://github.com/MaxWipfli
Commit: 628c7f094f
Pull-request: https://github.com/SerenityOS/serenity/pull/7478
Reviewed-by: https://github.com/awesomekling
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