def disabled(func):
    """Disable a function previously decorated with a listener like registerSignal.

	If the decorated function (`func`) has been decorated with :any:`registerSignal`,
	:any:`registerEventFilter` or some other kind of listener decorator, the decorated function
	will not be called anymore when a matching signal is emitted or a event has to pass in a
	filter, until it is enabled again.

	This decorator simply sets an ``enabled`` attribute on the decorated function to False.
	To re-enable the disabled function, just set the ``enabled`` attribute to True.

	When the function is re-enabled, missed signals and events will not cause the decorated
	function to be called, but upcoming signals/events will trigger the decorated function.

	Since functions decorated with :any:`registerSetup` can be triggered only when an object
	_starts_ matching categories, re-enabling such a function will not catch-up the setup of
	an object.
	"""
    func.enabled = False
    return func
