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

LibCore: Remove ObjectPtr in favor of RefPtr

Now that CObject is fully ref-counted, just use RefPtr everywhere! :^)
This commit is contained in:
Andreas Kling 2019-09-22 00:31:54 +02:00
parent bc319d9e88
commit d6abfbdc5a
71 changed files with 146 additions and 156 deletions

View file

@ -31,7 +31,7 @@ public:
BoolModelEditingDelegate() {}
virtual ~BoolModelEditingDelegate() override {}
virtual ObjectPtr<GWidget> create_widget() override
virtual RefPtr<GWidget> create_widget() override
{
auto combo = GComboBox::construct(nullptr);
combo->set_only_allow_values_from_model(true);

View file

@ -15,5 +15,5 @@ public:
const GTableView& table_view() const { return *m_table_view; }
private:
ObjectPtr<GTableView> m_table_view;
RefPtr<GTableView> m_table_view;
};

View file

@ -81,7 +81,7 @@ private:
VBWidgetType m_type { VBWidgetType::None };
VBForm& m_form;
ObjectPtr<GWidget> m_gwidget;
RefPtr<GWidget> m_gwidget;
NonnullOwnPtrVector<VBProperty> m_properties;
NonnullRefPtr<VBWidgetPropertyModel> m_property_model;
Rect m_transform_origin_rect;

View file

@ -68,7 +68,7 @@ VBWidgetType widget_type_from_class_name(const StringView& name)
ASSERT_NOT_REACHED();
}
static ObjectPtr<GWidget> build_gwidget(VBWidgetType type, GWidget* parent)
static RefPtr<GWidget> build_gwidget(VBWidgetType type, GWidget* parent)
{
switch (type) {
case VBWidgetType::GWidget:
@ -125,7 +125,7 @@ static ObjectPtr<GWidget> build_gwidget(VBWidgetType type, GWidget* parent)
}
}
ObjectPtr<GWidget> VBWidgetRegistry::build_gwidget(VBWidget& widget, VBWidgetType type, GWidget* parent, NonnullOwnPtrVector<VBProperty>& properties)
RefPtr<GWidget> VBWidgetRegistry::build_gwidget(VBWidget& widget, VBWidgetType type, GWidget* parent, NonnullOwnPtrVector<VBProperty>& properties)
{
auto gwidget = ::build_gwidget(type, parent);
auto add_readonly_property = [&](const String& name, const GVariant& value) {

View file

@ -19,7 +19,7 @@ public:
callback((VBWidgetType)i);
}
static ObjectPtr<GWidget> build_gwidget(VBWidget&, VBWidgetType, GWidget* parent, NonnullOwnPtrVector<VBProperty>&);
static RefPtr<GWidget> build_gwidget(VBWidget&, VBWidgetType, GWidget* parent, NonnullOwnPtrVector<VBProperty>&);
};
String to_class_name(VBWidgetType);

View file

@ -17,7 +17,7 @@
#include <stdio.h>
#include <unistd.h>
static ObjectPtr<GWindow> make_toolbox_window();
static RefPtr<GWindow> make_toolbox_window();
int main(int argc, char** argv)
{
@ -74,7 +74,7 @@ int main(int argc, char** argv)
return app.exec();
}
ObjectPtr<GWindow> make_toolbox_window()
RefPtr<GWindow> make_toolbox_window()
{
auto window = GWindow::construct();
window->set_title("Widgets");