Python: Add virtual env name to auto detected interpreters

Change-Id: Ia4d2e5399aa983b6bca510ca8b0e6848da5f769a
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
This commit is contained in:
David Schulz
2019-10-01 14:51:13 +02:00
parent aa8ce0ba24
commit 6d5c61b164

View File

@@ -287,6 +287,9 @@ Interpreter interpreterForPythonExecutable(const FilePath &python,
name = defaultName;
if (windowedSuffix)
name += " (Windowed)";
QDir pythonDir(python.parentDir().toString());
if (pythonDir.exists() && pythonDir.exists("activate") && pythonDir.cdUp())
name += QString(" (%1 Virtual Environment)").arg(pythonDir.dirName());
return Interpreter{QUuid::createUuid().toString(), name, python};
}