event-dispatcher: Add an enumeration of default event hook priorities
This scheme provides for an orderly execution of hooks as the priorities are controlled from one single place. Enumeration is defined in such a way that new items can be added easily. All the event hooks are changed to get the priorities from this enumeration.
This commit is contained in:

committed by
Julian Bouzas

parent
9337bb25ef
commit
6e31b47c28
@@ -173,7 +173,8 @@ wp_default_nodes_api_enable (WpPlugin * plugin, WpTransition * transition)
|
||||
g_return_if_fail (dispatcher);
|
||||
|
||||
/* default metadata added */
|
||||
hook = wp_simple_event_hook_new ("default-nodes", 10,
|
||||
hook = wp_simple_event_hook_new ("default-nodes-api",
|
||||
WP_EVENT_HOOK_DEFAULT_PRIORITY_DEFAULT_METADATA_ADDED_DEFAULT_NODES_API,
|
||||
WP_EVENT_HOOK_EXEC_TYPE_ON_EVENT,
|
||||
g_cclosure_new ((GCallback) on_metadata_added, self, NULL));
|
||||
wp_interest_event_hook_add_interest (WP_INTEREST_EVENT_HOOK (hook),
|
||||
@@ -185,7 +186,8 @@ wp_default_nodes_api_enable (WpPlugin * plugin, WpTransition * transition)
|
||||
g_clear_object(&hook);
|
||||
|
||||
/* default metadata changed */
|
||||
hook = wp_simple_event_hook_new ("default-nodes", 10,
|
||||
hook = wp_simple_event_hook_new ("default-nodes-api",
|
||||
WP_EVENT_HOOK_DEFAULT_PRIORITY_DEFAULT_METADATA_CHANGED_DEFAULT_NODES_API,
|
||||
WP_EVENT_HOOK_EXEC_TYPE_ON_EVENT,
|
||||
g_cclosure_new ((GCallback) on_metadata_changed_hook, self, NULL));
|
||||
wp_interest_event_hook_add_interest (WP_INTEREST_EVENT_HOOK (hook),
|
||||
|
Reference in New Issue
Block a user