mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 12:18:25 +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:
committed by
Andreas Kling
parent
5caaa52bee
commit
628c7f094f
@@ -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 {};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user