diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 7afe438ea6b..158a102ad1b 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -809,6 +809,8 @@ Interpreter InterpreterAspect::currentInterpreter() const void InterpreterAspect::updateInterpreters(const QList &interpreters) { + if (m_interpreters == interpreters) + return; m_interpreters = interpreters; if (m_comboBox) updateComboBox(); @@ -816,9 +818,11 @@ void InterpreterAspect::updateInterpreters(const QList &interpreter void InterpreterAspect::setDefaultInterpreter(const Interpreter &interpreter) { + if (m_defaultId == interpreter.id) + return; m_defaultId = interpreter.id; if (m_currentId.isEmpty()) - m_currentId = m_defaultId; + setCurrentInterpreter(interpreter); } void InterpreterAspect::setCurrentInterpreter(const Interpreter &interpreter) @@ -829,14 +833,13 @@ void InterpreterAspect::setCurrentInterpreter(const Interpreter &interpreter) return; m_comboBox->setCurrentIndex(index); } else { - m_currentId = interpreter.id; + setCurrentInterpreterId(interpreter.id); } - emit changed(); } void InterpreterAspect::fromMap(const QVariantMap &map) { - m_currentId = map.value(settingsKey(), m_defaultId).toString(); + setCurrentInterpreterId(map.value(settingsKey(), m_defaultId).toString()); } void InterpreterAspect::toMap(QVariantMap &map) const @@ -862,15 +865,22 @@ void InterpreterAspect::addToLayout(LayoutItem &builder) builder.addItems({Tr::tr("Interpreter:"), m_comboBox.data(), manageButton}); } +void InterpreterAspect::setCurrentInterpreterId(const QString &id) +{ + if (id == m_currentId) + return; + m_currentId = id; + emit changed(); +} + void InterpreterAspect::updateCurrentInterpreter() { const int index = m_comboBox->currentIndex(); if (index < 0) return; QTC_ASSERT(index < m_interpreters.size(), return); - m_currentId = m_interpreters[index].id; m_comboBox->setToolTip(m_interpreters[index].command.toUserOutput()); - emit changed(); + setCurrentInterpreterId(m_interpreters[index].id); } void InterpreterAspect::updateComboBox() diff --git a/src/plugins/projectexplorer/runconfigurationaspects.h b/src/plugins/projectexplorer/runconfigurationaspects.h index 7865aef3775..e9f88d8a011 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.h +++ b/src/plugins/projectexplorer/runconfigurationaspects.h @@ -245,6 +245,7 @@ public: struct Data : Utils::BaseAspect::Data { Interpreter interpreter; }; private: + void setCurrentInterpreterId(const QString &id); void updateCurrentInterpreter(); void updateComboBox(); QList m_interpreters; diff --git a/src/plugins/python/pythonrunconfiguration.cpp b/src/plugins/python/pythonrunconfiguration.cpp index 4675ef4b1bf..05366abff24 100644 --- a/src/plugins/python/pythonrunconfiguration.cpp +++ b/src/plugins/python/pythonrunconfiguration.cpp @@ -127,7 +127,6 @@ public: { connect(q, &InterpreterAspect::changed, this, &PythonInterpreterAspectPrivate::currentInterpreterChanged); - currentInterpreterChanged(); connect(PySideInstaller::instance(), &PySideInstaller::pySideInstalled, this, [this](const FilePath &python) {