diff --git a/Applications/FileManager/DirectoryTableModel.cpp b/Applications/FileManager/DirectoryModel.cpp similarity index 89% rename from Applications/FileManager/DirectoryTableModel.cpp rename to Applications/FileManager/DirectoryModel.cpp index 6b093a6181..77cd8dfec7 100644 --- a/Applications/FileManager/DirectoryTableModel.cpp +++ b/Applications/FileManager/DirectoryModel.cpp @@ -1,4 +1,4 @@ -#include "DirectoryTableModel.h" +#include "DirectoryModel.h" #include #include #include @@ -7,7 +7,7 @@ #include #include -DirectoryTableModel::DirectoryTableModel() +DirectoryModel::DirectoryModel() { m_directory_icon = GraphicsBitmap::load_from_file("/res/icons/folder16.png"); m_file_icon = GraphicsBitmap::load_from_file("/res/icons/file16.png"); @@ -27,21 +27,21 @@ DirectoryTableModel::DirectoryTableModel() endgrent(); } -DirectoryTableModel::~DirectoryTableModel() +DirectoryModel::~DirectoryModel() { } -int DirectoryTableModel::row_count() const +int DirectoryModel::row_count() const { return m_directories.size() + m_files.size(); } -int DirectoryTableModel::column_count() const +int DirectoryModel::column_count() const { return Column::__Count; } -String DirectoryTableModel::column_name(int column) const +String DirectoryModel::column_name(int column) const { switch (column) { case Column::Icon: return ""; @@ -55,7 +55,7 @@ String DirectoryTableModel::column_name(int column) const ASSERT_NOT_REACHED(); } -GTableModel::ColumnMetadata DirectoryTableModel::column_metadata(int column) const +GModel::ColumnMetadata DirectoryModel::column_metadata(int column) const { switch (column) { case Column::Icon: return { 16, TextAlignment::Center }; @@ -69,7 +69,7 @@ GTableModel::ColumnMetadata DirectoryTableModel::column_metadata(int column) con ASSERT_NOT_REACHED(); } -const GraphicsBitmap& DirectoryTableModel::icon_for(const Entry& entry) const +const GraphicsBitmap& DirectoryModel::icon_for(const Entry& entry) const { if (S_ISDIR(entry.mode)) return *m_directory_icon; @@ -122,7 +122,7 @@ static String permission_string(mode_t mode) return builder.to_string(); } -String DirectoryTableModel::name_for_uid(uid_t uid) const +String DirectoryModel::name_for_uid(uid_t uid) const { auto it = m_user_names.find(uid); if (it == m_user_names.end()) @@ -130,7 +130,7 @@ String DirectoryTableModel::name_for_uid(uid_t uid) const return (*it).value; } -String DirectoryTableModel::name_for_gid(uid_t gid) const +String DirectoryModel::name_for_gid(uid_t gid) const { auto it = m_user_names.find(gid); if (it == m_user_names.end()) @@ -138,7 +138,7 @@ String DirectoryTableModel::name_for_gid(uid_t gid) const return (*it).value; } -GVariant DirectoryTableModel::data(const GModelIndex& index, Role role) const +GVariant DirectoryModel::data(const GModelIndex& index, Role role) const { ASSERT(is_valid(index)); auto& entry = this->entry(index.row()); @@ -168,7 +168,7 @@ GVariant DirectoryTableModel::data(const GModelIndex& index, Role role) const return { }; } -void DirectoryTableModel::update() +void DirectoryModel::update() { DIR* dirp = opendir(m_path.characters()); if (!dirp) { @@ -204,7 +204,7 @@ void DirectoryTableModel::update() did_update(); } -void DirectoryTableModel::open(const String& a_path) +void DirectoryModel::open(const String& a_path) { FileSystemPath canonical_path(a_path); auto path = canonical_path.string(); @@ -219,7 +219,7 @@ void DirectoryTableModel::open(const String& a_path) set_selected_index({ 0, 0 }); } -void DirectoryTableModel::activate(const GModelIndex& index) +void DirectoryModel::activate(const GModelIndex& index) { if (!index.is_valid()) return; diff --git a/Applications/FileManager/DirectoryTableModel.h b/Applications/FileManager/DirectoryModel.h similarity index 88% rename from Applications/FileManager/DirectoryTableModel.h rename to Applications/FileManager/DirectoryModel.h index 44fd01e524..592eac9887 100644 --- a/Applications/FileManager/DirectoryTableModel.h +++ b/Applications/FileManager/DirectoryModel.h @@ -1,13 +1,13 @@ #pragma once -#include +#include #include #include -class DirectoryTableModel final : public GTableModel { +class DirectoryModel final : public GModel { public: - static Retained create() { return adopt(*new DirectoryTableModel); } - virtual ~DirectoryTableModel() override; + static Retained create() { return adopt(*new DirectoryModel); } + virtual ~DirectoryModel() override; enum Column { Icon = 0, @@ -33,7 +33,7 @@ public: size_t bytes_in_files() const { return m_bytes_in_files; } private: - DirectoryTableModel(); + DirectoryModel(); String name_for_uid(uid_t) const; String name_for_gid(gid_t) const; diff --git a/Applications/FileManager/DirectoryTableView.cpp b/Applications/FileManager/DirectoryTableView.cpp index bd43d47988..a445f22216 100644 --- a/Applications/FileManager/DirectoryTableView.cpp +++ b/Applications/FileManager/DirectoryTableView.cpp @@ -1,12 +1,12 @@ #include "DirectoryTableView.h" -#include +#include DirectoryTableView::DirectoryTableView(GWidget* parent) : GTableView(parent) - , m_model(DirectoryTableModel::create()) + , m_model(DirectoryModel::create()) { - set_model(GSortingProxyTableModel::create(m_model.copy_ref())); - GTableView::model()->set_key_column_and_sort_order(DirectoryTableModel::Column::Name, GSortOrder::Ascending); + set_model(GSortingProxyModel::create(m_model.copy_ref())); + GTableView::model()->set_key_column_and_sort_order(DirectoryModel::Column::Name, GSortOrder::Ascending); } DirectoryTableView::~DirectoryTableView() diff --git a/Applications/FileManager/DirectoryTableView.h b/Applications/FileManager/DirectoryTableView.h index dac693e799..5725ff7d58 100644 --- a/Applications/FileManager/DirectoryTableView.h +++ b/Applications/FileManager/DirectoryTableView.h @@ -2,7 +2,7 @@ #include #include -#include "DirectoryTableModel.h" +#include "DirectoryModel.h" class DirectoryTableView final : public GTableView { public: @@ -21,10 +21,10 @@ public: private: virtual void model_notification(const GModelNotification&) override; - DirectoryTableModel& model() { return *m_model; } - const DirectoryTableModel& model() const { return *m_model; } + DirectoryModel& model() { return *m_model; } + const DirectoryModel& model() const { return *m_model; } void set_status_message(const String&); - Retained m_model; + Retained m_model; }; diff --git a/Applications/FileManager/Makefile b/Applications/FileManager/Makefile index 305da08c0e..4d435c5903 100644 --- a/Applications/FileManager/Makefile +++ b/Applications/FileManager/Makefile @@ -1,5 +1,5 @@ OBJS = \ - DirectoryTableModel.o \ + DirectoryModel.o \ DirectoryTableView.o \ main.o diff --git a/Applications/IRCClient/IRCChannelMemberListModel.cpp b/Applications/IRCClient/IRCChannelMemberListModel.cpp index 442cdd3384..8e474d7e7a 100644 --- a/Applications/IRCClient/IRCChannelMemberListModel.cpp +++ b/Applications/IRCClient/IRCChannelMemberListModel.cpp @@ -31,7 +31,7 @@ String IRCChannelMemberListModel::column_name(int column) const ASSERT_NOT_REACHED(); } -GTableModel::ColumnMetadata IRCChannelMemberListModel::column_metadata(int column) const +GModel::ColumnMetadata IRCChannelMemberListModel::column_metadata(int column) const { switch (column) { case Column::Name: return { 70, TextAlignment::CenterLeft }; diff --git a/Applications/IRCClient/IRCChannelMemberListModel.h b/Applications/IRCClient/IRCChannelMemberListModel.h index 661a0d07a9..e3c48a2755 100644 --- a/Applications/IRCClient/IRCChannelMemberListModel.h +++ b/Applications/IRCClient/IRCChannelMemberListModel.h @@ -1,11 +1,11 @@ #pragma once -#include +#include #include class IRCChannel; -class IRCChannelMemberListModel final : public GTableModel { +class IRCChannelMemberListModel final : public GModel { public: enum Column { Name }; static Retained create(IRCChannel& channel) { return adopt(*new IRCChannelMemberListModel(channel)); } diff --git a/Applications/IRCClient/IRCLogBufferModel.cpp b/Applications/IRCClient/IRCLogBufferModel.cpp index db396c61f0..26d7d7b5ad 100644 --- a/Applications/IRCClient/IRCLogBufferModel.cpp +++ b/Applications/IRCClient/IRCLogBufferModel.cpp @@ -33,7 +33,7 @@ String IRCLogBufferModel::column_name(int column) const ASSERT_NOT_REACHED(); } -GTableModel::ColumnMetadata IRCLogBufferModel::column_metadata(int column) const +GModel::ColumnMetadata IRCLogBufferModel::column_metadata(int column) const { switch (column) { case Column::Timestamp: return { 60, TextAlignment::CenterLeft }; diff --git a/Applications/IRCClient/IRCLogBufferModel.h b/Applications/IRCClient/IRCLogBufferModel.h index 446b4b2ecb..dfceaa21e3 100644 --- a/Applications/IRCClient/IRCLogBufferModel.h +++ b/Applications/IRCClient/IRCLogBufferModel.h @@ -1,10 +1,10 @@ #pragma once -#include +#include class IRCLogBuffer; -class IRCLogBufferModel final : public GTableModel { +class IRCLogBufferModel final : public GModel { public: enum Column { Timestamp = 0, diff --git a/Applications/IRCClient/IRCWindowListModel.cpp b/Applications/IRCClient/IRCWindowListModel.cpp index a167df21fe..b2ac45ad8b 100644 --- a/Applications/IRCClient/IRCWindowListModel.cpp +++ b/Applications/IRCClient/IRCWindowListModel.cpp @@ -33,7 +33,7 @@ String IRCWindowListModel::column_name(int column) const ASSERT_NOT_REACHED(); } -GTableModel::ColumnMetadata IRCWindowListModel::column_metadata(int column) const +GModel::ColumnMetadata IRCWindowListModel::column_metadata(int column) const { switch (column) { case Column::Name: return { 70, TextAlignment::CenterLeft }; diff --git a/Applications/IRCClient/IRCWindowListModel.h b/Applications/IRCClient/IRCWindowListModel.h index 1157280bc4..192053e82c 100644 --- a/Applications/IRCClient/IRCWindowListModel.h +++ b/Applications/IRCClient/IRCWindowListModel.h @@ -1,12 +1,12 @@ #pragma once -#include +#include #include class IRCClient; class IRCWindow; -class IRCWindowListModel final : public GTableModel { +class IRCWindowListModel final : public GModel { public: enum Column { Name, diff --git a/Applications/ProcessManager/Makefile b/Applications/ProcessManager/Makefile index 6ed785ce1e..b594f90ff4 100644 --- a/Applications/ProcessManager/Makefile +++ b/Applications/ProcessManager/Makefile @@ -1,5 +1,5 @@ OBJS = \ - ProcessTableModel.o \ + ProcessModel.o \ ProcessTableView.o \ MemoryStatsWidget.o \ main.o diff --git a/Applications/ProcessManager/ProcessTableModel.cpp b/Applications/ProcessManager/ProcessModel.cpp similarity index 93% rename from Applications/ProcessManager/ProcessTableModel.cpp rename to Applications/ProcessManager/ProcessModel.cpp index df5ce5be99..6af2b3d98f 100644 --- a/Applications/ProcessManager/ProcessTableModel.cpp +++ b/Applications/ProcessManager/ProcessModel.cpp @@ -1,10 +1,10 @@ -#include "ProcessTableModel.h" +#include "ProcessModel.h" #include #include #include #include -ProcessTableModel::ProcessTableModel() +ProcessModel::ProcessModel() { setpwent(); while (auto* passwd = getpwent()) @@ -17,21 +17,21 @@ ProcessTableModel::ProcessTableModel() m_normal_priority_icon = GraphicsBitmap::load_from_file("/res/icons/normalpriority16.png"); } -ProcessTableModel::~ProcessTableModel() +ProcessModel::~ProcessModel() { } -int ProcessTableModel::row_count() const +int ProcessModel::row_count() const { return m_processes.size(); } -int ProcessTableModel::column_count() const +int ProcessModel::column_count() const { return Column::__Count; } -String ProcessTableModel::column_name(int column) const +String ProcessModel::column_name(int column) const { switch (column) { case Column::Icon: return ""; @@ -47,7 +47,7 @@ String ProcessTableModel::column_name(int column) const } } -GTableModel::ColumnMetadata ProcessTableModel::column_metadata(int column) const +GModel::ColumnMetadata ProcessModel::column_metadata(int column) const { switch (column) { case Column::Icon: return { 16, TextAlignment::CenterLeft }; @@ -68,7 +68,7 @@ static String pretty_byte_size(size_t size) return String::format("%uK", size / 1024); } -GVariant ProcessTableModel::data(const GModelIndex& index, Role role) const +GVariant ProcessModel::data(const GModelIndex& index, Role role) const { ASSERT(is_valid(index)); @@ -123,7 +123,7 @@ GVariant ProcessTableModel::data(const GModelIndex& index, Role role) const return { }; } -void ProcessTableModel::update() +void ProcessModel::update() { GFile file("/proc/all"); if (!file.open(GIODevice::ReadOnly)) { diff --git a/Applications/ProcessManager/ProcessTableModel.h b/Applications/ProcessManager/ProcessModel.h similarity index 84% rename from Applications/ProcessManager/ProcessTableModel.h rename to Applications/ProcessManager/ProcessModel.h index 743b0b8bcf..c30a2718d4 100644 --- a/Applications/ProcessManager/ProcessTableModel.h +++ b/Applications/ProcessManager/ProcessModel.h @@ -3,10 +3,10 @@ #include #include #include -#include +#include #include -class ProcessTableModel final : public GTableModel { +class ProcessModel final : public GModel { public: enum Column { Icon = 0, @@ -21,8 +21,8 @@ public: __Count }; - static Retained create() { return adopt(*new ProcessTableModel); } - virtual ~ProcessTableModel() override; + static Retained create() { return adopt(*new ProcessModel); } + virtual ~ProcessModel() override; virtual int row_count() const override; virtual int column_count() const override; @@ -32,7 +32,7 @@ public: virtual void update() override; private: - ProcessTableModel(); + ProcessModel(); struct ProcessState { pid_t pid; diff --git a/Applications/ProcessManager/ProcessTableView.cpp b/Applications/ProcessManager/ProcessTableView.cpp index 1c10572ec3..621c0c1593 100644 --- a/Applications/ProcessManager/ProcessTableView.cpp +++ b/Applications/ProcessManager/ProcessTableView.cpp @@ -1,13 +1,13 @@ #include "ProcessTableView.h" -#include "ProcessTableModel.h" -#include +#include "ProcessModel.h" +#include #include ProcessTableView::ProcessTableView(GWidget* parent) : GTableView(parent) { - set_model(GSortingProxyTableModel::create(ProcessTableModel::create())); - model()->set_key_column_and_sort_order(ProcessTableModel::Column::CPU, GSortOrder::Descending); + set_model(GSortingProxyModel::create(ProcessModel::create())); + model()->set_key_column_and_sort_order(ProcessModel::Column::CPU, GSortOrder::Descending); start_timer(1000); model()->update(); } @@ -33,5 +33,5 @@ pid_t ProcessTableView::selected_pid() const { if (!model()->selected_index().is_valid()) return -1; - return model()->data({ model()->selected_index().row(), ProcessTableModel::Column::PID }, GTableModel::Role::Sort).as_int(); + return model()->data({ model()->selected_index().row(), ProcessModel::Column::PID }, GModel::Role::Sort).as_int(); } diff --git a/Applications/ProcessManager/ProcessTableView.h b/Applications/ProcessManager/ProcessTableView.h index 3ecd2c1c08..5b8ee61d30 100644 --- a/Applications/ProcessManager/ProcessTableView.h +++ b/Applications/ProcessManager/ProcessTableView.h @@ -4,7 +4,7 @@ #include #include -class ProcessTableModel; +class ProcessModel; class ProcessTableView final : public GTableView { public: diff --git a/LibGUI/GTableModel.cpp b/LibGUI/GModel.cpp similarity index 57% rename from LibGUI/GTableModel.cpp rename to LibGUI/GModel.cpp index 4cd6bdc468..ebb6e16f36 100644 --- a/LibGUI/GTableModel.cpp +++ b/LibGUI/GModel.cpp @@ -1,31 +1,31 @@ -#include +#include #include -GTableModel::GTableModel() +GModel::GModel() { } -GTableModel::~GTableModel() +GModel::~GModel() { } -void GTableModel::register_view(Badge, GTableView& view) +void GModel::register_view(Badge, GTableView& view) { m_views.set(&view); } -void GTableModel::unregister_view(Badge, GTableView& view) +void GModel::unregister_view(Badge, GTableView& view) { m_views.remove(&view); } -void GTableModel::for_each_view(Function callback) +void GModel::for_each_view(Function callback) { for (auto* view : m_views) callback(*view); } -void GTableModel::did_update() +void GModel::did_update() { if (on_model_update) on_model_update(*this); @@ -34,7 +34,7 @@ void GTableModel::did_update() }); } -void GTableModel::set_selected_index(const GModelIndex& index) +void GModel::set_selected_index(const GModelIndex& index) { if (m_selected_index == index) return; diff --git a/LibGUI/GTableModel.h b/LibGUI/GModel.h similarity index 94% rename from LibGUI/GTableModel.h rename to LibGUI/GModel.h index 11b8466040..dd564ff3eb 100644 --- a/LibGUI/GTableModel.h +++ b/LibGUI/GModel.h @@ -34,7 +34,7 @@ private: GModelIndex m_index; }; -class GTableModel : public Retainable { +class GModel : public Retainable { public: struct ColumnMetadata { int preferred_width { 0 }; @@ -44,7 +44,7 @@ public: enum class Role { Display, Sort, Custom, ForegroundColor, BackgroundColor }; - virtual ~GTableModel(); + virtual ~GModel(); virtual int row_count() const = 0; virtual int column_count() const = 0; @@ -73,11 +73,11 @@ public: void register_view(Badge, GTableView&); void unregister_view(Badge, GTableView&); - Function on_model_update; + Function on_model_update; Function on_selection_changed; protected: - GTableModel(); + GModel(); void for_each_view(Function); void did_update(); diff --git a/LibGUI/GSortingProxyTableModel.cpp b/LibGUI/GSortingProxyModel.cpp similarity index 61% rename from LibGUI/GSortingProxyTableModel.cpp rename to LibGUI/GSortingProxyModel.cpp index c86d955956..82b9e4fd08 100644 --- a/LibGUI/GSortingProxyTableModel.cpp +++ b/LibGUI/GSortingProxyModel.cpp @@ -1,32 +1,32 @@ -#include +#include #include #include #include -GSortingProxyTableModel::GSortingProxyTableModel(Retained&& target) +GSortingProxyModel::GSortingProxyModel(Retained&& target) : m_target(move(target)) , m_key_column(-1) { - m_target->on_model_update = [this] (GTableModel&) { + m_target->on_model_update = [this] (GModel&) { resort(); }; } -GSortingProxyTableModel::~GSortingProxyTableModel() +GSortingProxyModel::~GSortingProxyModel() { } -int GSortingProxyTableModel::row_count() const +int GSortingProxyModel::row_count() const { return target().row_count(); } -int GSortingProxyTableModel::column_count() const +int GSortingProxyModel::column_count() const { return target().column_count(); } -GModelIndex GSortingProxyTableModel::map_to_target(const GModelIndex& index) const +GModelIndex GSortingProxyModel::map_to_target(const GModelIndex& index) const { if (!index.is_valid()) return { }; @@ -35,37 +35,37 @@ GModelIndex GSortingProxyTableModel::map_to_target(const GModelIndex& index) con return { m_row_mappings[index.row()], index.column() }; } -String GSortingProxyTableModel::row_name(int index) const +String GSortingProxyModel::row_name(int index) const { return target().row_name(index); } -String GSortingProxyTableModel::column_name(int index) const +String GSortingProxyModel::column_name(int index) const { return target().column_name(index); } -GTableModel::ColumnMetadata GSortingProxyTableModel::column_metadata(int index) const +GModel::ColumnMetadata GSortingProxyModel::column_metadata(int index) const { return target().column_metadata(index); } -GVariant GSortingProxyTableModel::data(const GModelIndex& index, Role role) const +GVariant GSortingProxyModel::data(const GModelIndex& index, Role role) const { return target().data(map_to_target(index), role); } -void GSortingProxyTableModel::activate(const GModelIndex& index) +void GSortingProxyModel::activate(const GModelIndex& index) { target().activate(map_to_target(index)); } -void GSortingProxyTableModel::update() +void GSortingProxyModel::update() { target().update(); } -void GSortingProxyTableModel::set_key_column_and_sort_order(int column, GSortOrder sort_order) +void GSortingProxyModel::set_key_column_and_sort_order(int column, GSortOrder sort_order) { if (column == m_key_column && sort_order == m_sort_order) return; @@ -76,7 +76,7 @@ void GSortingProxyTableModel::set_key_column_and_sort_order(int column, GSortOrd resort(); } -void GSortingProxyTableModel::resort() +void GSortingProxyModel::resort() { int previously_selected_target_row = map_to_target(selected_index()).row(); int row_count = target().row_count(); @@ -86,8 +86,8 @@ void GSortingProxyTableModel::resort() if (m_key_column == -1) return; quick_sort(m_row_mappings.begin(), m_row_mappings.end(), [&] (auto row1, auto row2) -> bool { - auto data1 = target().data({ row1, m_key_column }, GTableModel::Role::Sort); - auto data2 = target().data({ row2, m_key_column }, GTableModel::Role::Sort); + auto data1 = target().data({ row1, m_key_column }, GModel::Role::Sort); + auto data2 = target().data({ row2, m_key_column }, GModel::Role::Sort); if (data1 == data2) return 0; bool is_less_than = data1 < data2; diff --git a/LibGUI/GSortingProxyTableModel.h b/LibGUI/GSortingProxyModel.h similarity index 64% rename from LibGUI/GSortingProxyTableModel.h rename to LibGUI/GSortingProxyModel.h index feb8bfae54..5352d33946 100644 --- a/LibGUI/GSortingProxyTableModel.h +++ b/LibGUI/GSortingProxyModel.h @@ -1,11 +1,11 @@ #pragma once -#include +#include -class GSortingProxyTableModel final : public GTableModel { +class GSortingProxyModel final : public GModel { public: - static Retained create(Retained&& model) { return adopt(*new GSortingProxyTableModel(move(model))); } - virtual ~GSortingProxyTableModel() override; + static Retained create(Retained&& model) { return adopt(*new GSortingProxyModel(move(model))); } + virtual ~GSortingProxyModel() override; virtual int row_count() const override; virtual int column_count() const override; @@ -23,14 +23,14 @@ public: GModelIndex map_to_target(const GModelIndex&) const; private: - explicit GSortingProxyTableModel(Retained&&); + explicit GSortingProxyModel(Retained&&); - GTableModel& target() { return *m_target; } - const GTableModel& target() const { return *m_target; } + GModel& target() { return *m_target; } + const GModel& target() const { return *m_target; } void resort(); - Retained m_target; + Retained m_target; Vector m_row_mappings; int m_key_column { -1 }; GSortOrder m_sort_order { GSortOrder::Ascending }; diff --git a/LibGUI/GTableView.cpp b/LibGUI/GTableView.cpp index f5f384ba5e..cd54d1d71b 100644 --- a/LibGUI/GTableView.cpp +++ b/LibGUI/GTableView.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include @@ -13,7 +13,7 @@ GTableView::~GTableView() { } -void GTableView::set_model(RetainPtr&& model) +void GTableView::set_model(RetainPtr&& model) { if (model.ptr() == m_model.ptr()) return; @@ -162,7 +162,7 @@ void GTableView::paint_event(GPaintEvent& event) if (is_selected_row) text_color = Color::White; else - text_color = m_model->data(cell_index, GTableModel::Role::ForegroundColor).to_color(Color::Black); + text_color = m_model->data(cell_index, GModel::Role::ForegroundColor).to_color(Color::Black); painter.draw_text(cell_rect, data.to_string(), font, column_metadata.text_alignment, text_color); } x_offset += column_width + horizontal_padding() * 2; diff --git a/LibGUI/GTableView.h b/LibGUI/GTableView.h index 4a8e3f97b8..2d967b0acb 100644 --- a/LibGUI/GTableView.h +++ b/LibGUI/GTableView.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include #include @@ -16,9 +16,9 @@ public: int header_height() const { return m_headers_visible ? 16 : 0; } int item_height() const { return 16; } - void set_model(RetainPtr&&); - GTableModel* model() { return m_model.ptr(); } - const GTableModel* model() const { return m_model.ptr(); } + void set_model(RetainPtr&&); + GModel* model() { return m_model.ptr(); } + const GModel* model() const { return m_model.ptr(); } bool headers_visible() const { return m_headers_visible; } void set_headers_visible(bool headers_visible) { m_headers_visible = headers_visible; } @@ -53,7 +53,7 @@ private: void update_content_size(); Vector m_column_visibility; - RetainPtr m_model; + RetainPtr m_model; int m_horizontal_padding { 5 }; bool m_headers_visible { true }; bool m_alternating_row_colors { true }; diff --git a/LibGUI/Makefile b/LibGUI/Makefile index 5cf1c4abeb..0e5977a077 100644 --- a/LibGUI/Makefile +++ b/LibGUI/Makefile @@ -32,12 +32,12 @@ LIBGUI_OBJS = \ GFontDatabase.o \ GToolBar.o \ GTableView.o \ - GTableModel.o \ + GModel.o \ GVariant.o \ GShortcut.o \ GTextEditor.o \ GClipboard.o \ - GSortingProxyTableModel.o \ + GSortingProxyModel.o \ GStackWidget.o \ GEvent.o \ GScrollableWidget.o \