From 5467a7c2b1fb1831ca726d1ecb6b46010d146ebc Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 27 Mar 2025 08:27:32 +0100 Subject: adw: clean up implementation --- adw/src/preferencesrow.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'adw/src/preferencesrow.cpp') diff --git a/adw/src/preferencesrow.cpp b/adw/src/preferencesrow.cpp index ef9b281..039da96 100644 --- a/adw/src/preferencesrow.cpp +++ b/adw/src/preferencesrow.cpp @@ -10,7 +10,8 @@ #include #include -#include +#include +#include #include #include @@ -21,13 +22,13 @@ namespace turns::adw namespace { auto constinit _class = PreferencesRow::Class{}; - } + } // namespace auto PreferencesRow::Class::init() -> Glib::Class const & { if (!gtype_) { - class_init_func_ = &PreferencesRow::Class::class_init_function; + class_init_func_ = &class_init_function; register_derived_type(adw_preferences_row_get_type()); } return *this; @@ -35,13 +36,13 @@ namespace turns::adw auto PreferencesRow::Class::class_init_function(void * gclass, void * data) -> void { - auto const klass = static_cast(gclass); - Gtk::Widget_Class::class_init_function(klass, data); + auto const klass = static_cast(gclass); + CppClassParent::class_init_function(klass, data); } auto PreferencesRow::Class::wrap_new(GObject * object) -> Glib::ObjectBase * { - return new PreferencesRow(ADW_PREFERENCES_ROW(object)); + return Gtk::manage(new PreferencesRow(ADW_PREFERENCES_ROW(object))); } auto PreferencesRow::get_type() -> GType @@ -90,8 +91,7 @@ namespace turns::adw } PreferencesRow::PreferencesRow(BaseObjectType * gobj) - : Glib::ObjectBase{nullptr} - , Gtk::ListBoxRow(GTK_LIST_BOX_ROW(gobj)) + : Gtk::ListBoxRow(GTK_LIST_BOX_ROW(gobj)) { } @@ -101,7 +101,6 @@ namespace Glib { auto wrap(AdwPreferencesRow * object, bool copy) -> Glib::RefPtr { - return Glib::make_refptr_for_instance( - dynamic_cast(Glib::wrap_auto(G_OBJECT(object), copy))); + return Glib::make_refptr_for_instance(dynamic_cast(Glib::wrap_auto(G_OBJECT(object), copy))); } } // namespace Glib \ No newline at end of file -- cgit v1.2.3