event: move cancelling of events on pw-proxy-destroyed to m-std-event-source
It is really out of place to do this inside WpEvent, as it is not a generic action. It should only happen for some events.
This commit is contained in:

committed by
Julian Bouzas

parent
3a23fb451a
commit
ffa85840ac
@@ -79,19 +79,6 @@ form_event_name (WpEvent *e)
|
||||
);
|
||||
}
|
||||
|
||||
static void
|
||||
on_proxy_destroyed (GObject* self, WpEvent* e)
|
||||
{
|
||||
if (e->subject == self) {
|
||||
const gchar* type = wp_properties_get (e->properties, "event.type");
|
||||
/* object removal needs to be processed by hooks */
|
||||
if (g_str_equal (type, "object-removed"))
|
||||
wp_properties_set (e->properties, "pw-proxy-destroyed", "true");
|
||||
else
|
||||
g_cancellable_cancel (e->cancellable);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Creates a new event
|
||||
* \ingroup wpevent
|
||||
@@ -143,12 +130,6 @@ wp_event_new (const gchar * type, gint priority, WpProperties * properties,
|
||||
wp_properties_update (self->properties, subj_props);
|
||||
}
|
||||
}
|
||||
|
||||
/* watch for subject pw-proxy-destroyed and cancel event */
|
||||
if (g_type_is_a (G_OBJECT_TYPE (self->subject), WP_TYPE_PROXY)) {
|
||||
g_signal_connect (self->subject, "pw-proxy-destroyed",
|
||||
(GCallback) on_proxy_destroyed, self);
|
||||
}
|
||||
}
|
||||
|
||||
wp_properties_set (self->properties, "event.type", type);
|
||||
|
Reference in New Issue
Block a user