graesslin added a comment.
In D11447#229337 <https://phabricator.kde.org/D11447#229337>, @fvogt wrote: > In D11447#229334 <https://phabricator.kde.org/D11447#229334>, @graesslin wrote: > > > In D11447#229128 <https://phabricator.kde.org/D11447#229128>, @fvogt wrote: > > > > > If `KWorkSpace::detectPlatform(argc, argv);` were changed to edit `argc` and `argv` to pass `-platform foo` instead of setting `QT_QPA_PLATFORM`, the `qunsetenv` calls would become unnecessary. > > > > > > but that sounds rather dangerous. I don't want to mess with the command line arguments > > > Why is that more dangerous than environment variables? > If argc and argv are passed to `QApplication`, you already know how it'll be parsed. Because I don't see how I could add something to argv without leaking memory and potentially crash. I consider it as dangerous to modify the argv array and adding elements to it. It's something I do not dare. REPOSITORY R120 Plasma Workspace BRANCH unset-qt-qpa-platform REVISION DETAIL https://phabricator.kde.org/D11447 To: graesslin, #plasma, davidedmundson Cc: romangg, fvogt, plasma-devel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart