mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
AK: Add a canonicalized_path() convenience function.
This is the same as calling FileSystemPath(foo).string(). The majority of clients only care about canonicalizing a path, so let's have an easy way to express that.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 13:15:54 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/954a0b8efec
@@ -92,7 +92,7 @@ struct GFileSystemModel::Node {
|
||||
}
|
||||
builder.append('/');
|
||||
builder.append(name);
|
||||
return FileSystemPath(builder.to_string()).string();
|
||||
return canonicalized_path(builder.to_string());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -130,7 +130,7 @@ String GFileSystemModel::path(const GModelIndex& index) const
|
||||
}
|
||||
|
||||
GFileSystemModel::GFileSystemModel(const StringView& root_path, Mode mode)
|
||||
: m_root_path(FileSystemPath(root_path).string())
|
||||
: m_root_path(canonicalized_path(root_path))
|
||||
, m_mode(mode)
|
||||
{
|
||||
m_open_folder_icon = GIcon::default_icon("filetype-folder-open");
|
||||
|
||||
Reference in New Issue
Block a user