Comment 40 for bug 587597

Revision history for this message
Crise / MW (markuwil) wrote : Re: Plugins support

So, to address the issue of PluginManager::onFooEvent calls that Steven brought up... to do that the existing listeners in dcpp are useless since most of them are fired in "past tense" in other words fired after an action is complete.

So even if it is possible to address the listeners not being able to affect what happens after the call, to make any sensible use of them in cases where they are not used right now (for plugins) would need either new events added for everything or drastically changing the existing events.

About onFooEvent calls in general, they are purely convenience functions anyways each eventually leading to PluginManager::callHook, so if individual events having functions in PluginManager is the root of the problem it is possible to make the calls with a single function provided you initialize the needed structs "on the spot" for every call.

The only sensible solution to make use of listeners as much as possible that I could think of is to add PluginEvent() event to each needed listener and member method that returns the POD representation of the object to the needed classes. The question is, how much is gained by doing this contrary to having it the way it is now... the number affected lines will only stand to increase. Though I can see certain advantages of having the POD representations returned by a member method.