Skip to content

Commit

Permalink
[gtk] NautilusPlugin.cpp: Move the AchGDBus::instnace() call to rp_na…
Browse files Browse the repository at this point in the history
…utilus_register_types().

Reduces duplicated code lines in the GTK3 version.
For GTK4, it keeps consistency with the GTK3 version.
  • Loading branch information
GerbilSoft committed Dec 21, 2024
1 parent 14d184e commit 6162805
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
20 changes: 5 additions & 15 deletions src/gtk/gtk3/NautilusPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 **/
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down
10 changes: 5 additions & 5 deletions src/gtk/gtk4/NautilusPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 **/
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 6162805

Please sign in to comment.