mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
FileManager: Set up the model error/complete callbacks earlier
We need to set these up before calling set_root_path, as that's where the error callbacks would fire from.
This commit is contained in:
parent
0b746075d8
commit
39a7358b51
Notes:
sideshowbarker
2024-07-19 01:48:21 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/39a7358b515
1 changed files with 3 additions and 3 deletions
|
@ -158,9 +158,6 @@ const GUI::FileSystemModel::Node& DirectoryView::node(const GUI::ModelIndex& ind
|
|||
|
||||
void DirectoryView::setup_model()
|
||||
{
|
||||
if (is_desktop())
|
||||
m_model->set_root_path(Core::StandardPaths::desktop_directory());
|
||||
|
||||
m_model->on_error = [this](int, const char* error_string) {
|
||||
auto failed_path = m_model->root_path();
|
||||
auto error_message = String::formatted("Could not read {}:\n{}", failed_path, error_string);
|
||||
|
@ -199,6 +196,9 @@ void DirectoryView::setup_model()
|
|||
if (on_thumbnail_progress)
|
||||
on_thumbnail_progress(done, total);
|
||||
};
|
||||
|
||||
if (is_desktop())
|
||||
m_model->set_root_path(Core::StandardPaths::desktop_directory());
|
||||
}
|
||||
|
||||
void DirectoryView::setup_icon_view()
|
||||
|
|
Loading…
Reference in a new issue