1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27:35 +00:00

LibGUI: Convert GTableView to ObjectPtr

This commit is contained in:
Andreas Kling 2019-09-21 16:03:59 +02:00
parent c13b9e2214
commit e7b55037f4
20 changed files with 27 additions and 26 deletions

View file

@ -18,7 +18,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget(GWidget* parent)
adapters_group_box->set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
adapters_group_box->set_preferred_size(0, 120);
m_adapter_table_view = new GTableView(adapters_group_box);
m_adapter_table_view = GTableView::construct(adapters_group_box);
m_adapter_table_view->set_size_columns_to_fit_content(true);
Vector<GJsonArrayModel::FieldSpec> net_adapters_fields;
@ -38,7 +38,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget(GWidget* parent)
sockets_group_box->set_size_policy(SizePolicy::Fill, SizePolicy::Fill);
sockets_group_box->set_preferred_size(0, 0);
m_socket_table_view = new GTableView(sockets_group_box);
m_socket_table_view = GTableView::construct(sockets_group_box);
m_socket_table_view->set_size_columns_to_fit_content(true);
Vector<GJsonArrayModel::FieldSpec> net_tcp_fields;

View file

@ -14,7 +14,7 @@ public:
private:
void update_models();
GTableView* m_adapter_table_view { nullptr };
GTableView* m_socket_table_view { nullptr };
ObjectPtr<GTableView> m_adapter_table_view;
ObjectPtr<GTableView> m_socket_table_view;
ObjectPtr<CTimer> m_update_timer;
};

View file

@ -8,7 +8,7 @@ ProcessFileDescriptorMapWidget::ProcessFileDescriptorMapWidget(GWidget* parent)
{
set_layout(make<GBoxLayout>(Orientation::Vertical));
layout()->set_margins({ 4, 4, 4, 4 });
m_table_view = new GTableView(this);
m_table_view = GTableView::construct(this);
m_table_view->set_size_columns_to_fit_content(true);
Vector<GJsonArrayModel::FieldSpec> pid_fds_fields;

View file

@ -13,6 +13,6 @@ public:
void set_pid(pid_t);
private:
GTableView* m_table_view { nullptr };
ObjectPtr<GTableView> m_table_view;
pid_t m_pid { -1 };
};

View file

@ -8,7 +8,7 @@ ProcessMemoryMapWidget::ProcessMemoryMapWidget(GWidget* parent)
{
set_layout(make<GBoxLayout>(Orientation::Vertical));
layout()->set_margins({ 4, 4, 4, 4 });
m_table_view = new GTableView(this);
m_table_view = GTableView::construct(this);
m_table_view->set_size_columns_to_fit_content(true);
Vector<GJsonArrayModel::FieldSpec> pid_vm_fields;
pid_vm_fields.empend("Address", TextAlignment::CenterLeft, [](auto& object) {

View file

@ -13,6 +13,6 @@ public:
void set_pid(pid_t);
private:
GTableView* m_table_view { nullptr };
ObjectPtr<GTableView> m_table_view;
pid_t m_pid { -1 };
};

View file

@ -239,7 +239,7 @@ GWidget* build_file_systems_tab()
auto* fs_widget = new GWidget(nullptr);
fs_widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
fs_widget->layout()->set_margins({ 4, 4, 4, 4 });
auto* fs_table_view = new GTableView(fs_widget);
auto fs_table_view = GTableView::construct(fs_widget);
fs_table_view->set_size_columns_to_fit_content(true);
Vector<GJsonArrayModel::FieldSpec> df_fields;
@ -304,7 +304,7 @@ GWidget* build_pci_devices_tab()
auto* pci_widget = new GWidget(nullptr);
pci_widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
pci_widget->layout()->set_margins({ 4, 4, 4, 4 });
auto* pci_table_view = new GTableView(pci_widget);
auto pci_table_view = GTableView::construct(pci_widget);
pci_table_view->set_size_columns_to_fit_content(true);
auto db = PCIDB::Database::open();
@ -359,7 +359,7 @@ GWidget* build_devices_tab()
devices_widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
devices_widget->layout()->set_margins({ 4, 4, 4, 4 });
auto* devices_table_view = new GTableView(devices_widget);
auto devices_table_view = GTableView::construct(devices_widget);
devices_table_view->set_size_columns_to_fit_content(true);
devices_table_view->set_model(GSortingProxyModel::create(DevicesModel::create()));
devices_table_view->model()->update();