mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 02:45:07 +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
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()
|
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) {
|
m_model->on_error = [this](int, const char* error_string) {
|
||||||
auto failed_path = m_model->root_path();
|
auto failed_path = m_model->root_path();
|
||||||
auto error_message = String::formatted("Could not read {}:\n{}", failed_path, error_string);
|
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)
|
if (on_thumbnail_progress)
|
||||||
on_thumbnail_progress(done, total);
|
on_thumbnail_progress(done, total);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (is_desktop())
|
||||||
|
m_model->set_root_path(Core::StandardPaths::desktop_directory());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DirectoryView::setup_icon_view()
|
void DirectoryView::setup_icon_view()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue