Python: fix opening repl for project files

The python interpreter aspect relyed on having a combo box setup when
looking up the current interpreter. This combo box is just initialized
when the widget is shown since recently. Using the current id that is
valid all the time instead to get the correct interpreter.

Change-Id: I0a6bde46864c44c9408d0d7331164b49da65c7df
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
David Schulz
2021-06-10 10:14:51 +02:00
parent cb1b86645a
commit 9decfcb151

View File

@@ -160,7 +160,7 @@ private:
Interpreter InterpreterAspect::currentInterpreter() const
{
return m_comboBox ? m_interpreters.value(m_comboBox->currentIndex()) : Interpreter();
return Utils::findOrDefault(m_interpreters, Utils::equal(&Interpreter::id, m_currentId));
}
void InterpreterAspect::updateInterpreters(const QList<Interpreter> &interpreters)