qt.conf is overwritten
https://github.com/linuxdeploy/linuxdeploy-plugin-qt/blob/master/src/deployment.h#L50 "Overwriting existing qt.conf file". You should not overwritting custom qt.conf. I have a specific configuration for my application (this is the point of qt.conf) that you remove to fit to the plugin. I think you want to protect the hard coded paths with
ofs << "# generated by linuxdeploy-plugin-qt" << std::endl
<< "[Paths]" << std::endl
<< "Prefix = ../" << std::endl
<< "Plugins = plugins" << std::endl
<< "Imports = qml" << std::endl
<< "Qml2Imports = qml" << std::endl;
but you may inform it rather than erasing all configurations.
Interesting point. I have never heard of applications using a custom qt.conf before.
Would it be safe to simply append our fixes (appending to an existing value if necessary)?
I don't think so. The [Path] is more exhaustive than Prefix, Plugins, Imports and Qml2Imports and can be before another tags (like [Platforms]) (Plus I don't know what the behaviour to have 2 Paths tags or 2 same variables) Just not erase and print some warnings was an easy workaround (it should be the responsability to the developer to knowing what he does ;) ) but is not enough. The better solution would be to do "insert or update" : It will ensure that variables used by linuxdeploy are set in the right way. I see something like that : First test on file. If it exists, test on [Paths] else create it like now. If tag not exists, create the section else test each fields : If one exists, replace the field else create it in the section
That's what I wanted to suggest. I think with a simple INI-style parser and a few lines of code we could properly implement this.
We'd have to check if https://github.com/jtilly/inih works.
Oups sorry, I stopped on the meaning of "append our fixes" :p
Retrospectively I should have worded this differently, I have to admit.