diff --git a/src/plugins/python/pythonsettings.cpp b/src/plugins/python/pythonsettings.cpp index f54b4ac85c0..acb7a50ddd3 100644 --- a/src/plugins/python/pythonsettings.cpp +++ b/src/plugins/python/pythonsettings.cpp @@ -467,6 +467,10 @@ void PythonSettings::init() void PythonSettings::setInterpreter(const QList &interpreters, const QString &defaultId) { + if (defaultId == interpreterOptionsPage().defaultInterpreter().id + && interpreters == interpreterOptionsPage().interpreters()) { + return; + } interpreterOptionsPage().setInterpreter(interpreters); interpreterOptionsPage().setDefaultInterpreter(defaultId); saveSettings(); diff --git a/src/plugins/python/pythonsettings.h b/src/plugins/python/pythonsettings.h index 02c62ab65fc..0ef6c62a0ff 100644 --- a/src/plugins/python/pythonsettings.h +++ b/src/plugins/python/pythonsettings.h @@ -44,6 +44,11 @@ public: const QString &name, const Utils::FilePath &command); + inline bool operator==(const Interpreter &other) const + { + return id == other.id && name == other.name && command == other.command; + } + QString id = QUuid::createUuid().toString(); QString name; Utils::FilePath command;