[gnome-settings-daemon/wip/benzea/cleanups-and-small-fixes: 12/18] dummy: Use G_DECLARE_FINAL_TYPE for GsdDummyManager



commit 17a5db78e462b246f46331dc7c2313c701ba0db7
Author: Benjamin Berg <bberg redhat com>
Date:   Wed Feb 20 15:28:00 2019 +0100

    dummy: Use G_DECLARE_FINAL_TYPE for GsdDummyManager

 plugins/dummy/gsd-dummy-manager.c | 16 ++--------------
 plugins/dummy/gsd-dummy-manager.h | 21 +--------------------
 2 files changed, 3 insertions(+), 34 deletions(-)
---
diff --git a/plugins/dummy/gsd-dummy-manager.c b/plugins/dummy/gsd-dummy-manager.c
index 5e5f9453..49743831 100644
--- a/plugins/dummy/gsd-dummy-manager.c
+++ b/plugins/dummy/gsd-dummy-manager.c
@@ -27,11 +27,9 @@
 #include "gnome-settings-profile.h"
 #include "gsd-dummy-manager.h"
 
-#define GSD_DUMMY_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_DUMMY_MANAGER, 
GsdDummyManagerPrivate))
-
-struct GsdDummyManagerPrivate
+struct _GsdDummyManager
 {
-        gboolean padding;
+        GObject         parent;
 };
 
 enum {
@@ -118,29 +116,19 @@ gsd_dummy_manager_class_init (GsdDummyManagerClass *klass)
         object_class->constructor = gsd_dummy_manager_constructor;
         object_class->dispose = gsd_dummy_manager_dispose;
         object_class->finalize = gsd_dummy_manager_finalize;
-
-        g_type_class_add_private (klass, sizeof (GsdDummyManagerPrivate));
 }
 
 static void
 gsd_dummy_manager_init (GsdDummyManager *manager)
 {
-        manager->priv = GSD_DUMMY_MANAGER_GET_PRIVATE (manager);
-
 }
 
 static void
 gsd_dummy_manager_finalize (GObject *object)
 {
-        GsdDummyManager *dummy_manager;
-
         g_return_if_fail (object != NULL);
         g_return_if_fail (GSD_IS_DUMMY_MANAGER (object));
 
-        dummy_manager = GSD_DUMMY_MANAGER (object);
-
-        g_return_if_fail (dummy_manager->priv != NULL);
-
         G_OBJECT_CLASS (gsd_dummy_manager_parent_class)->finalize (object);
 }
 
diff --git a/plugins/dummy/gsd-dummy-manager.h b/plugins/dummy/gsd-dummy-manager.h
index ace87d16..ac503001 100644
--- a/plugins/dummy/gsd-dummy-manager.h
+++ b/plugins/dummy/gsd-dummy-manager.h
@@ -25,26 +25,7 @@
 G_BEGIN_DECLS
 
 #define GSD_TYPE_DUMMY_MANAGER         (gsd_dummy_manager_get_type ())
-#define GSD_DUMMY_MANAGER(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_DUMMY_MANAGER, 
GsdDummyManager))
-#define GSD_DUMMY_MANAGER_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_DUMMY_MANAGER, 
GsdDummyManagerClass))
-#define GSD_IS_DUMMY_MANAGER(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_DUMMY_MANAGER))
-#define GSD_IS_DUMMY_MANAGER_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_DUMMY_MANAGER))
-#define GSD_DUMMY_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_DUMMY_MANAGER, 
GsdDummyManagerClass))
-
-typedef struct GsdDummyManagerPrivate GsdDummyManagerPrivate;
-
-typedef struct
-{
-        GObject                     parent;
-        GsdDummyManagerPrivate *priv;
-} GsdDummyManager;
-
-typedef struct
-{
-        GObjectClass   parent_class;
-} GsdDummyManagerClass;
-
-GType                   gsd_dummy_manager_get_type            (void);
+G_DECLARE_FINAL_TYPE (GsdDummyManager, gsd_dummy_manager, GSD, DUMMY_MANAGER, GObject)
 
 GsdDummyManager *       gsd_dummy_manager_new                 (void);
 gboolean                gsd_dummy_manager_start               (GsdDummyManager *manager,


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