summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/FileSystemModel.cpp
diff options
context:
space:
mode:
authorMax Wipfli <mail@maxwipfli.ch>2021-05-29 23:15:54 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-01 09:28:05 +0200
commit628c7f094f78d06d28c9fe0f14968e00e82e5be3 (patch)
tree37f2426b6716282c13f02ee6fa05839d9e30d707 /Userland/Libraries/LibGUI/FileSystemModel.cpp
parent5caaa52bee16b4016cfee5ae0a78292c5c0987d5 (diff)
downloadserenity-628c7f094f78d06d28c9fe0f14968e00e82e5be3.zip
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().
Diffstat (limited to 'Userland/Libraries/LibGUI/FileSystemModel.cpp')
-rw-r--r--Userland/Libraries/LibGUI/FileSystemModel.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/Userland/Libraries/LibGUI/FileSystemModel.cpp b/Userland/Libraries/LibGUI/FileSystemModel.cpp
index 39580681ce..696f1ddd03 100644
--- a/Userland/Libraries/LibGUI/FileSystemModel.cpp
+++ b/Userland/Libraries/LibGUI/FileSystemModel.cpp
@@ -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 {};
}