From d73117d1ef0656fd8001e7bedfae76c3db2f6aea Mon Sep 17 00:00:00 2001 From: Richard Cohen Date: Mon, 12 Jun 2023 19:11:45 +0100 Subject: [PATCH] Refactor: DECLARE_FINAL GncPluginLogReplay < GncPlugin - Fix the name --- .../log-replay/gnc-plugin-log-replay.c | 12 ++++++------ .../log-replay/gnc-plugin-log-replay.h | 17 +++-------------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/gnucash/import-export/log-replay/gnc-plugin-log-replay.c b/gnucash/import-export/log-replay/gnc-plugin-log-replay.c index 28b11592bd..0e278ab3d6 100644 --- a/gnucash/import-export/log-replay/gnc-plugin-log-replay.c +++ b/gnucash/import-export/log-replay/gnc-plugin-log-replay.c @@ -54,15 +54,15 @@ static const gchar *gnc_plugin_load_ui_items [] = NULL, }; -typedef struct GncPluginLogreplayPrivate +typedef struct GncPluginLogReplayPrivate { gpointer dummy; -} GncPluginLogreplayPrivate; +} GncPluginLogReplayPrivate; -G_DEFINE_TYPE_WITH_PRIVATE(GncPluginLogreplay, gnc_plugin_log_replay, GNC_TYPE_PLUGIN) +G_DEFINE_TYPE_WITH_PRIVATE(GncPluginLogReplay, gnc_plugin_log_replay, GNC_TYPE_PLUGIN) #define GNC_PLUGIN_LOG_REPLAY_GET_PRIVATE(o) \ - ((GncPluginLogreplayPrivate*)gnc_plugin_log_replay_get_instance_private((GncPluginLogReplay*)o)) + ((GncPluginLogReplayPrivate*)gnc_plugin_log_replay_get_instance_private((GncPluginLogReplay*)o)) GncPlugin * gnc_plugin_log_replay_new (void) @@ -71,7 +71,7 @@ gnc_plugin_log_replay_new (void) } static void -gnc_plugin_log_replay_class_init (GncPluginLogreplayClass *klass) +gnc_plugin_log_replay_class_init (GncPluginLogReplayClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass); @@ -90,7 +90,7 @@ gnc_plugin_log_replay_class_init (GncPluginLogreplayClass *klass) } static void -gnc_plugin_log_replay_init (GncPluginLogreplay *plugin) +gnc_plugin_log_replay_init (GncPluginLogReplay *plugin) { } diff --git a/gnucash/import-export/log-replay/gnc-plugin-log-replay.h b/gnucash/import-export/log-replay/gnc-plugin-log-replay.h index e2f0a8c13a..c74e04bff8 100644 --- a/gnucash/import-export/log-replay/gnc-plugin-log-replay.h +++ b/gnucash/import-export/log-replay/gnc-plugin-log-replay.h @@ -31,28 +31,17 @@ G_BEGIN_DECLS /* type macros */ #define GNC_TYPE_PLUGIN_LOG_REPLAY (gnc_plugin_log_replay_get_type ()) -#define GNC_PLUGIN_LOG_REPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_LOG_REPLAY, GncPluginLogreplay)) -#define GNC_PLUGIN_LOG_REPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_LOG_REPLAY, GncPluginLogreplayClass)) -#define GNC_IS_PLUGIN_LOG_REPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_LOG_REPLAY)) -#define GNC_IS_PLUGIN_LOG_REPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_LOG_REPLAY)) -#define GNC_PLUGIN_LOG_REPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_LOG_REPLAY, GncPluginLogreplayClass)) +G_DECLARE_FINAL_TYPE (GncPluginLogReplay, gnc_plugin_log_replay, GNC, PLUGIN_LOG_REPLAY, GncPlugin) #define GNC_PLUGIN_LOG_REPLAY_NAME "gnc-plugin-log-replay" /* typedefs & structures */ -typedef struct +struct _GncPluginLogReplay { GncPlugin gnc_plugin; -} GncPluginLogreplay; - -typedef struct -{ - GncPluginClass gnc_plugin; -} GncPluginLogreplayClass; +}; /* function prototypes */ -GType gnc_plugin_log_replay_get_type (void); - GncPlugin *gnc_plugin_log_replay_new (void); void gnc_plugin_log_replay_create_plugin (void);