Commit 4480c359 authored by Garrett Regier's avatar Garrett Regier

Initialize the peas-extension-type quark in class_init when possible

parent 59350369
......@@ -44,8 +44,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (PeasPluginLoaderC,
#define GET_PRIV(o) \
(peas_plugin_loader_c_get_instance_private (o))
static
G_DEFINE_QUARK (peas-extension-type, extension_type)
static GQuark quark_extension_type = 0;
static gboolean
peas_plugin_loader_c_load (PeasPluginLoader *loader,
......@@ -145,7 +144,7 @@ peas_plugin_loader_c_create_extension (PeasPluginLoader *loader,
/* We have to remember which interface we are instantiating
* for the deprecated peas_extension_get_extension_type().
*/
g_object_set_qdata (instance, extension_type_quark (),
g_object_set_qdata (instance, quark_extension_type,
GSIZE_TO_POINTER (exten_type));
return instance;
......@@ -182,6 +181,8 @@ peas_plugin_loader_c_class_init (PeasPluginLoaderCClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
PeasPluginLoaderClass *loader_class = PEAS_PLUGIN_LOADER_CLASS (klass);
quark_extension_type = g_quark_from_static_string ("peas-extension-type");
object_class->finalize = peas_plugin_loader_c_finalize;
loader_class->load = peas_plugin_loader_c_load;
......
......@@ -54,8 +54,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (PeasPluginLoaderLua,
#define GET_PRIV(o) \
(peas_plugin_loader_lua_get_instance_private (o))
static
G_DEFINE_QUARK (peas-extension-type, extension_type)
static GQuark quark_extension_type = 0;
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
......@@ -181,7 +180,7 @@ peas_plugin_loader_lua_create_extension (PeasPluginLoader *loader,
/* We have to remember which interface we are instantiating
* for the deprecated peas_extension_get_extension_type().
*/
g_object_set_qdata (object, extension_type_quark (),
g_object_set_qdata (object, quark_extension_type,
GSIZE_TO_POINTER (exten_type));
luaL_checkstack (L, 2, "");
......@@ -374,6 +373,8 @@ peas_plugin_loader_lua_class_init (PeasPluginLoaderLuaClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
PeasPluginLoaderClass *loader_class = PEAS_PLUGIN_LOADER_CLASS (klass);
quark_extension_type = g_quark_from_static_string ("peas-extension-type");
object_class->finalize = peas_plugin_loader_lua_finalize;
loader_class->initialize = peas_plugin_loader_lua_initialize;
......
......@@ -50,8 +50,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (PeasPluginLoaderPython,
#define GET_PRIV(o) \
(peas_plugin_loader_python_get_instance_private (o))
static
G_DEFINE_QUARK (peas-extension-type, extension_type)
static GQuark quark_extension_type = 0;
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
......@@ -127,7 +126,7 @@ peas_plugin_loader_python_create_extension (PeasPluginLoader *loader,
/* We have to remember which interface we are instantiating
* for the deprecated peas_extension_get_extension_type().
*/
g_object_set_qdata (object, extension_type_quark (),
g_object_set_qdata (object, quark_extension_type,
GSIZE_TO_POINTER (exten_type));
pyobject = pygobject_new (object);
......@@ -341,6 +340,8 @@ peas_plugin_loader_python_class_init (PeasPluginLoaderPythonClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
PeasPluginLoaderClass *loader_class = PEAS_PLUGIN_LOADER_CLASS (klass);
quark_extension_type = g_quark_from_static_string ("peas-extension-type");
object_class->finalize = peas_plugin_loader_python_finalize;
loader_class->initialize = peas_plugin_loader_python_initialize;
......
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