-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deduplicate Qt plugins deployment #175
base: master
Are you sure you want to change the base?
Conversation
488aa4b
to
0dd355f
Compare
I have update with my .clang-format but still a bit different, I can manually fix it by hand :(, but I'd rather wait for your review and input about code style :) |
0dd355f
to
80d9946
Compare
This PR is unfortunately not acceptable because one cannot even tell what changes you implemented. You should never just run an autoformatter you like on an entire code base and the PR it. Feel free to fix the PR and provide just the changes you want to propose. But, generally, I advise people to open issues first. |
as I said I thought this project had .clang-format, it's a pain to work with projects that don't, and pre-commit just makes sure maintainers don't need to keed pointing to style issues which I have seen you pointing at on another PR. I there was a proper style file I could just rebase and the PR would be fine. |
80d9946
to
d00970d
Compare
cc46109
to
efacba7
Compare
@TheAssassin done, I didn't bother to remove the using namespace .. which is not in use anymore, I can remove if you like... |
efacba7
to
245d0bd
Compare
Basically, most deployers had the same code that I moved into |
@@ -29,7 +29,21 @@ BasicPluginsDeployer::BasicPluginsDeployer(std::string moduleName, | |||
qtDataPath(std::move(qtDataPath)) {} | |||
|
|||
bool BasicPluginsDeployer::deploy() { | |||
// currently this is a no-op, but we might add more functionality later on, such as some kinds of default | |||
// attempts to copy data based on the moduleName | |||
for (const auto &pluginName : qtPluginsToBeDeployed()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a nice cleanup, but instead of introducing this code here along with the qtPluginsToBeDeployed
function, I would suggest to introduce a protected BasicPluginsDeployer::deployPlugins(const std::vector<std::string> &plugins)
, so in each deploy()
implementation one could just do for example:
deployPlugins({"bearer"});
I think that's adding a bit less complexity overall, since it removes the need for both qtPluginsToBeDeployed
and customDeploy
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while a deployStandardQtPlugins()
could be nice indeed having a customDeploy()
or if going with this function then maybe doDeploy()
is a better naming, this is because we override methods and current code was calling the base method which makes the code slower due extra branching and is error prone as one has to remember to call that.
So I'll add a new commit and we see what is best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's better and I do think it's nice how doDeploy
allows to get rid of all the calls to the superclass. Though I would personally just have removed them, along with the base implementation, because "we might add more functionality later on" is not a good reason for all that cruft in my opinion.
Anyway, this patch is a good clean-up as-is in my opinion.
b195c7c
to
779d489
Compare
779d489
to
e50841a
Compare
Sorry I added pre-commit locally to make sure clang-format was run and apparently your sources were not in sync with it