mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
LibGUI: Pass path to FileSystemModel when creating FilePicker
This saves a few lstat lookups since otherwise '/' is indexed before set_path() is called. It also cleans up warnings if '/' is not unveiled when opening FilePicker, like in WidgetGallery.
This commit is contained in:
parent
6fae2a5f9e
commit
72a5347f91
Notes:
sideshowbarker
2024-07-18 08:50:59 +09:00
Author: https://github.com/metmo Commit: https://github.com/SerenityOS/serenity/commit/72a5347f914 Pull-request: https://github.com/SerenityOS/serenity/pull/8837
1 changed files with 2 additions and 2 deletions
|
@ -64,7 +64,7 @@ Optional<String> FilePicker::get_save_filepath(Window* parent_window, const Stri
|
|||
|
||||
FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& filename, const StringView& path)
|
||||
: Dialog(parent_window)
|
||||
, m_model(FileSystemModel::create())
|
||||
, m_model(FileSystemModel::create(path))
|
||||
, m_mode(mode)
|
||||
{
|
||||
switch (m_mode) {
|
||||
|
@ -232,7 +232,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& filen
|
|||
m_common_location_buttons.append({ path, button });
|
||||
}
|
||||
|
||||
set_path(path);
|
||||
m_location_textbox->set_icon(FileIconProvider::icon_for_path(path).bitmap_for_size(16));
|
||||
}
|
||||
|
||||
FilePicker::~FilePicker()
|
||||
|
|
Loading…
Reference in a new issue