Details
-
Bug
-
Resolution: Invalid
-
P5: Not important
-
None
-
Qt Creator 4.0.3, Qt Creator 4.2.0-beta1
-
OS X El Capitan
Version 10.11.5
Shell: zsh
Description
This feature doesn't work in either Qt Creator git or 4.0.3, at least on Mac. There are three issues that I have discovered so far:
- the QProcess used in PerforceChecker is using an empty QProcessEnvironment, so it never picks up the P4CONFIG environment variable;
- the working directory used to test the Perforce settings in Qt Creator is not set, which means the test always fails when using P4CONFIG;
- the QProcessEnvironment of the QProcesses used in PerforcePlugin is only ever set when the OverrideDiffEnvironment flag is set. This means that using P4CONFIG only actually works when running a Diff command.
Whilst investigating this issue, it seems like the system environment is expected to be set on the QProcesses used by default, otherwise how could P4CONFIG ever be detected? The QProcess::processEnvironment documentation states:
If no environment has been set, the environment of the calling process will be used.
It looks like either the environment of our calling process is being cleared, or the documentation is wrong.