mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-28 23:39:02 +00: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:
parent
cd497accbe
commit
954a0b8efe
Notes:
sideshowbarker
2024-07-19 13:15:54 +09:00
Author: https://github.com/awesomekling
Commit: 954a0b8efe
7 changed files with 33 additions and 25 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue