linuxdeploy-plugin-qt icon indicating copy to clipboard operation
linuxdeploy-plugin-qt copied to clipboard

qt.conf is overwritten

Open Ledjlale opened this issue 5 years ago • 5 comments

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.

Ledjlale avatar Apr 11 '20 10:04 Ledjlale

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)?

TheAssassin avatar Apr 11 '20 11:04 TheAssassin

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

Ledjlale avatar Apr 11 '20 14:04 Ledjlale

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.

TheAssassin avatar Apr 11 '20 15:04 TheAssassin

Oups sorry, I stopped on the meaning of "append our fixes" :p

Ledjlale avatar Apr 11 '20 16:04 Ledjlale

Retrospectively I should have worded this differently, I have to admit.

TheAssassin avatar Apr 11 '20 17:04 TheAssassin