Skip to content

Conversation

@taooceros
Copy link
Member

@taooceros taooceros commented Jan 29, 2021

Make most helper class in Explorer become static class.

I am not sure why by design, they are instance class (or a least singleton), and there are multiple duplicate instances. This pr makes them become static class because most of them don't save any information (except for ResultManager, which contains the PluginInitContext to change query), but just be used as a group of methods.

@taooceros taooceros added this to the 1.7.0 milestone Jan 29, 2021
@taooceros taooceros requested a review from jjw24 January 29, 2021 10:48
@taooceros taooceros added enhancement New feature or request Explorer Plugin Issue or Enhancement Link to Explorer Plugin labels Jan 29, 2021
@jjw24
Copy link
Member

jjw24 commented Feb 2, 2021

well for now it doesnt keep state, but later on it may such as allowing users to select how many results to display from index search.

What do you mean by there are multiple duplicate instances?

@taooceros
Copy link
Member Author

It seems that most class in explorer plugin contains an instance for ResultManager. Sometimes, the method call even use new ResultManager().createFileResult()....

@taooceros
Copy link
Member Author

Even if we may need to check how much results will be listed, most of the class still doesn't have to be instance class. The only class that may store the state maybe ResultManager (store a pointer to pluginAPI), and the queryconstructor (to store how much result to display).

jjw24
jjw24 previously approved these changes Feb 2, 2021
@jjw24 jjw24 merged commit 1ec5023 into Flow-Launcher:dev Feb 2, 2021
@taooceros taooceros deleted the ResultManagerSingleton branch February 2, 2021 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Explorer Plugin Issue or Enhancement Link to Explorer Plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants