mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
LibGUI: Remove confusing GModelNotification concept
This was a bad idea and it didn't stick. Instead we should just use the simple "on_foo" hook functions like we do for everything else. :^)
This commit is contained in:
parent
4f3234148a
commit
f7dce05c82
Notes:
sideshowbarker
2024-07-19 12:35:26 +09:00
Author: https://github.com/awesomekling
Commit: f7dce05c82
6 changed files with 8 additions and 51 deletions
|
@ -58,17 +58,15 @@ DirectoryView::DirectoryView(GWidget* parent)
|
|||
|
||||
m_item_view->set_model_column(GDirectoryModel::Column::Name);
|
||||
|
||||
m_item_view->on_model_notification = [this](const GModelNotification& notification) {
|
||||
if (notification.type() == GModelNotification::Type::ModelUpdated) {
|
||||
set_status_message(String::format("%d item%s (%u byte%s)",
|
||||
model().row_count(),
|
||||
model().row_count() != 1 ? "s" : "",
|
||||
model().bytes_in_files(),
|
||||
model().bytes_in_files() != 1 ? "s" : ""));
|
||||
m_table_view->model()->on_model_update = [this](auto&) {
|
||||
set_status_message(String::format("%d item%s (%u byte%s)",
|
||||
model().row_count(),
|
||||
model().row_count() != 1 ? "s" : "",
|
||||
model().bytes_in_files(),
|
||||
model().bytes_in_files() != 1 ? "s" : ""));
|
||||
|
||||
if (on_path_change)
|
||||
on_path_change(model().path());
|
||||
}
|
||||
if (on_path_change)
|
||||
on_path_change(model().path());
|
||||
};
|
||||
|
||||
m_model->on_thumbnail_progress = [this](int done, int total) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue