[gnome-builder] libide/tweaks: make tweaks panel final



commit 3955c063a5ab5aca249924f3c2ac1aaaa5f990f3
Author: Christian Hergert <chergert redhat com>
Date:   Tue Aug 2 21:43:13 2022 -0700

    libide/tweaks: make tweaks panel final
    
    For our empty state, we can figure something else out or use another
    child in the stack specifically for that.

 src/libide/tweaks/ide-tweaks-panel-private.h |  7 +------
 src/libide/tweaks/ide-tweaks-panel.c         | 23 +++++++++--------------
 2 files changed, 10 insertions(+), 20 deletions(-)
---
diff --git a/src/libide/tweaks/ide-tweaks-panel-private.h b/src/libide/tweaks/ide-tweaks-panel-private.h
index 00db0045b..5998bee4b 100644
--- a/src/libide/tweaks/ide-tweaks-panel-private.h
+++ b/src/libide/tweaks/ide-tweaks-panel-private.h
@@ -28,12 +28,7 @@ G_BEGIN_DECLS
 
 #define IDE_TYPE_TWEAKS_PANEL (ide_tweaks_panel_get_type())
 
-G_DECLARE_DERIVABLE_TYPE (IdeTweaksPanel, ide_tweaks_panel, IDE, TWEAKS_PANEL, AdwBin)
-
-struct _IdeTweaksPanelClass
-{
-  AdwBinClass parent_class;
-};
+G_DECLARE_FINAL_TYPE (IdeTweaksPanel, ide_tweaks_panel, IDE, TWEAKS_PANEL, AdwBin)
 
 IdeTweaksPage *ide_tweaks_panel_get_page   (IdeTweaksPanel *self);
 gboolean       ide_tweaks_panel_get_folded (IdeTweaksPanel *self);
diff --git a/src/libide/tweaks/ide-tweaks-panel.c b/src/libide/tweaks/ide-tweaks-panel.c
index b778f4e53..b5b9b08b4 100644
--- a/src/libide/tweaks/ide-tweaks-panel.c
+++ b/src/libide/tweaks/ide-tweaks-panel.c
@@ -25,11 +25,12 @@
 #include "ide-tweaks-page.h"
 #include "ide-tweaks-panel-private.h"
 
-typedef struct
+struct _IdeTweaksPanel
 {
+  AdwBin         parent_instance;
   IdeTweaksPage *page;
-  guint folded : 1;
-} IdeTweaksPanelPrivate;
+  guint          folded : 1;
+};
 
 enum {
   PROP_0,
@@ -38,7 +39,7 @@ enum {
   N_PROPS
 };
 
-G_DEFINE_TYPE_WITH_PRIVATE (IdeTweaksPanel, ide_tweaks_panel, ADW_TYPE_BIN)
+G_DEFINE_FINAL_TYPE (IdeTweaksPanel, ide_tweaks_panel, ADW_TYPE_BIN)
 
 static GParamSpec *properties [N_PROPS];
 
@@ -46,9 +47,8 @@ static void
 ide_tweaks_panel_dispose (GObject *object)
 {
   IdeTweaksPanel *self = (IdeTweaksPanel *)object;
-  IdeTweaksPanelPrivate *priv = ide_tweaks_panel_get_instance_private (self);
 
-  g_clear_object (&priv->page);
+  g_clear_object (&self->page);
 
   G_OBJECT_CLASS (ide_tweaks_panel_parent_class)->dispose (object);
 }
@@ -83,12 +83,11 @@ ide_tweaks_panel_set_property (GObject      *object,
                                GParamSpec   *pspec)
 {
   IdeTweaksPanel *self = IDE_TWEAKS_PANEL (object);
-  IdeTweaksPanelPrivate *priv = ide_tweaks_panel_get_instance_private (self);
 
   switch (prop_id)
     {
     case PROP_PAGE:
-      priv->page = g_value_dup_object (value);
+      self->page = g_value_dup_object (value);
       break;
 
     default:
@@ -130,19 +129,15 @@ ide_tweaks_panel_init (IdeTweaksPanel *self)
 IdeTweaksPage *
 ide_tweaks_panel_get_page (IdeTweaksPanel *self)
 {
-  IdeTweaksPanelPrivate *priv = ide_tweaks_panel_get_instance_private (self);
-
   g_return_val_if_fail (IDE_IS_TWEAKS_PANEL (self), NULL);
 
-  return priv->page;
+  return self->page;
 }
 
 gboolean
 ide_tweaks_panel_get_folded (IdeTweaksPanel *self)
 {
-  IdeTweaksPanelPrivate *priv = ide_tweaks_panel_get_instance_private (self);
-
   g_return_val_if_fail (IDE_IS_TWEAKS_PANEL (self), FALSE);
 
-  return priv->folded;
+  return self->folded;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]