From 6162805471d82d456d6ea99805de8b4cd73b4504 Mon Sep 17 00:00:00 2001 From: David Korth Date: Sat, 21 Dec 2024 18:11:54 -0500 Subject: [PATCH] [gtk] NautilusPlugin.cpp: Move the AchGDBus::instnace() call to rp_nautilus_register_types(). Reduces duplicated code lines in the GTK3 version. For GTK4, it keeps consistency with the GTK3 version. --- src/gtk/gtk3/NautilusPlugin.cpp | 20 +++++--------------- src/gtk/gtk4/NautilusPlugin.cpp | 10 +++++----- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/gtk/gtk3/NautilusPlugin.cpp b/src/gtk/gtk3/NautilusPlugin.cpp index b912ad57a..341fe8611 100644 --- a/src/gtk/gtk3/NautilusPlugin.cpp +++ b/src/gtk/gtk3/NautilusPlugin.cpp @@ -47,6 +47,11 @@ rp_nautilus_register_types(GTypeModule *g_module) /* Setup the plugin provider type list */ type_list[0] = RP_TYPE_NAUTILUS_PROPERTY_PAGE_PROVIDER; type_list[1] = RP_TYPE_NAUTILUS_MENU_PROVIDER; + +#ifdef ENABLE_ACHIEVEMENTS + // Register AchGDBus. + AchGDBus::instance(); +#endif /* ENABLE_ACHIEVEMENTS */ } /** Per-frontend initialization functions **/ @@ -89,11 +94,6 @@ nautilus_module_initialize(GTypeModule *g_module) { NAUTILUS_MODULE_INITIALIZE_FUNC_INT(nautilus); -#ifdef ENABLE_ACHIEVEMENTS - // Register AchGDBus. - AchGDBus::instance(); -#endif /* ENABLE_ACHIEVEMENTS */ - // Symbols loaded. Register our types. rp_nautilus_register_types(g_module); } @@ -106,11 +106,6 @@ caja_module_initialize(GTypeModule *g_module) // Initialize Caja-specific function pointers. rp_caja_init(libextension_so); -#ifdef ENABLE_ACHIEVEMENTS - // Register AchGDBus. - AchGDBus::instance(); -#endif /* ENABLE_ACHIEVEMENTS */ - // Symbols loaded. Register our types. rp_nautilus_register_types(g_module); } @@ -123,11 +118,6 @@ nemo_module_initialize(GTypeModule *g_module) // Initialize Nemo-specific function pointers. rp_nemo_init(libextension_so); -#ifdef ENABLE_ACHIEVEMENTS - // Register AchGDBus. - AchGDBus::instance(); -#endif /* ENABLE_ACHIEVEMENTS */ - // Symbols loaded. Register our types. rp_nautilus_register_types(g_module); } diff --git a/src/gtk/gtk4/NautilusPlugin.cpp b/src/gtk/gtk4/NautilusPlugin.cpp index cecb290ae..c45f75ab0 100644 --- a/src/gtk/gtk4/NautilusPlugin.cpp +++ b/src/gtk/gtk4/NautilusPlugin.cpp @@ -49,6 +49,11 @@ rp_nautilus_register_types(GTypeModule *module) /* Setup the plugin provider type list */ type_list[0] = RP_TYPE_NAUTILUS_PROPERTIES_MODEL_PROVIDER; type_list[1] = RP_TYPE_NAUTILUS_MENU_PROVIDER; + +#ifdef ENABLE_ACHIEVEMENTS + // Register AchGDBus. + AchGDBus::instance(); +#endif /* ENABLE_ACHIEVEMENTS */ } /** Per-frontend initialization functions **/ @@ -94,11 +99,6 @@ nautilus_module_initialize(GTypeModule *g_module) { NAUTILUS_MODULE_INITIALIZE_FUNC_INT(nautilus); -#ifdef ENABLE_ACHIEVEMENTS - // Register AchGDBus. - AchGDBus::instance(); -#endif /* ENABLE_ACHIEVEMENTS */ - // Symbols loaded. Register our types. rp_nautilus_register_types(g_module); }