Commit 69660986 authored by Garrett Regier's avatar Garrett Regier

Cleanup init function for interfaces

The function should be a static function. Also, it
will only ever be called once so there is no need
for doing the check/set initialized dance.
parent a30290fb
......@@ -38,13 +38,9 @@
G_DEFINE_INTERFACE(GeditAppActivatable, gedit_app_activatable, G_TYPE_OBJECT)
void
static void
gedit_app_activatable_default_init (GeditAppActivatableInterface *iface)
{
static gboolean initialized = FALSE;
if (!initialized)
{
/**
* GeditAppActivatable:app:
*
......@@ -59,9 +55,6 @@ gedit_app_activatable_default_init (GeditAppActivatableInterface *iface)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
initialized = TRUE;
}
}
/**
......
......@@ -50,13 +50,9 @@ confirm_overwrite_accumulator (GSignalInvocationHint *ihint,
return continue_emission;
}
void
static void
gedit_file_chooser_dialog_default_init (GeditFileChooserDialogInterface *iface)
{
static gboolean initialized = FALSE;
if (G_UNLIKELY (!initialized))
{
g_signal_new ("response",
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
......@@ -74,9 +70,6 @@ gedit_file_chooser_dialog_default_init (GeditFileChooserDialogInterface *iface)
gedit_marshal_ENUM__VOID,
GTK_TYPE_FILE_CHOOSER_CONFIRMATION,
0);
initialized = TRUE;
}
}
GeditFileChooserDialog *
......
......@@ -37,13 +37,9 @@
G_DEFINE_INTERFACE(GeditViewActivatable, gedit_view_activatable, G_TYPE_OBJECT)
void
static void
gedit_view_activatable_default_init (GeditViewActivatableInterface *iface)
{
static gboolean initialized = FALSE;
if (!initialized)
{
/**
* GeditViewActivatable:view:
*
......@@ -58,9 +54,6 @@ gedit_view_activatable_default_init (GeditViewActivatableInterface *iface)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
initialized = TRUE;
}
}
/**
......
......@@ -39,13 +39,9 @@
G_DEFINE_INTERFACE(GeditWindowActivatable, gedit_window_activatable, G_TYPE_OBJECT)
void
static void
gedit_window_activatable_default_init (GeditWindowActivatableInterface *iface)
{
static gboolean initialized = FALSE;
if (!initialized)
{
/**
* GeditWindowActivatable:window:
*
......@@ -60,9 +56,6 @@ gedit_window_activatable_default_init (GeditWindowActivatableInterface *iface)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
initialized = TRUE;
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment